summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-07-19 13:48:19 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-07-19 13:48:19 (GMT)
commit958fe81b045e54ed6dadfe1fa9b14ac317811abf (patch)
tree4d341a6780bafb187d8aa753de71582f68949da0 /Swiften/LinkLocal
parenta6fcd9e7aa12c5e00c61ff809e81fba14babd70c (diff)
downloadswift-958fe81b045e54ed6dadfe1fa9b14ac317811abf.zip
swift-958fe81b045e54ed6dadfe1fa9b14ac317811abf.tar.bz2
Factor out common code from ServerFromClientSession.
Diffstat (limited to 'Swiften/LinkLocal')
-rw-r--r--Swiften/LinkLocal/IncomingLinkLocalSession.cpp2
-rw-r--r--Swiften/LinkLocal/LinkLocalSession.cpp2
-rw-r--r--Swiften/LinkLocal/LinkLocalSession.h4
-rw-r--r--Swiften/LinkLocal/OutgoingLinkLocalSession.cpp16
-rw-r--r--Swiften/LinkLocal/OutgoingLinkLocalSession.h4
5 files changed, 14 insertions, 14 deletions
diff --git a/Swiften/LinkLocal/IncomingLinkLocalSession.cpp b/Swiften/LinkLocal/IncomingLinkLocalSession.cpp
index db4b007..b73e979 100644
--- a/Swiften/LinkLocal/IncomingLinkLocalSession.cpp
+++ b/Swiften/LinkLocal/IncomingLinkLocalSession.cpp
@@ -57,7 +57,7 @@ void IncomingLinkLocalSession::handleElement(boost::shared_ptr<Element> element)
if (isInitialized()) {
if (stanza) {
- onStanzaReceived(stanza);
+ onElementReceived(stanza);
}
else {
std::cerr << "Received unexpected element" << std::endl;
diff --git a/Swiften/LinkLocal/LinkLocalSession.cpp b/Swiften/LinkLocal/LinkLocalSession.cpp
index 0f106ae..60227a7 100644
--- a/Swiften/LinkLocal/LinkLocalSession.cpp
+++ b/Swiften/LinkLocal/LinkLocalSession.cpp
@@ -43,7 +43,7 @@ void LinkLocalSession::finishSession() {
connection->disconnect();
}
-void LinkLocalSession::sendStanza(boost::shared_ptr<Stanza> stanza) {
+void LinkLocalSession::sendElement(boost::shared_ptr<Element> stanza) {
xmppLayer->writeElement(stanza);
}
diff --git a/Swiften/LinkLocal/LinkLocalSession.h b/Swiften/LinkLocal/LinkLocalSession.h
index 6629a2a..4bec14d 100644
--- a/Swiften/LinkLocal/LinkLocalSession.h
+++ b/Swiften/LinkLocal/LinkLocalSession.h
@@ -35,13 +35,13 @@ namespace Swift {
void finishSession();
// TODO: Make non-virtual when OutgoingSession is fixed
- virtual void sendStanza(boost::shared_ptr<Stanza>);
+ virtual void sendElement(boost::shared_ptr<Element>);
virtual const JID& getRemoteJID() const = 0;
virtual void start() = 0;
- boost::signal<void (boost::shared_ptr<Stanza>)> onStanzaReceived;
+ boost::signal<void (boost::shared_ptr<Element>)> onElementReceived;
boost::signal<void (boost::optional<Error>)> onSessionFinished;
boost::signal<void ()> onSessionStarted;
boost::signal<void (const ByteArray&)> onDataWritten;
diff --git a/Swiften/LinkLocal/OutgoingLinkLocalSession.cpp b/Swiften/LinkLocal/OutgoingLinkLocalSession.cpp
index f97520a..7415174 100644
--- a/Swiften/LinkLocal/OutgoingLinkLocalSession.cpp
+++ b/Swiften/LinkLocal/OutgoingLinkLocalSession.cpp
@@ -77,28 +77,28 @@ void OutgoingLinkLocalSession::handleConnected(bool error) {
}
void OutgoingLinkLocalSession::handleStreamStart(const ProtocolHeader&) {
- foreach(const boost::shared_ptr<Stanza>& stanza, queuedStanzas_) {
- LinkLocalSession::sendStanza(stanza);
+ foreach(const boost::shared_ptr<Element>& stanza, queuedElements_) {
+ LinkLocalSession::sendElement(stanza);
}
- queuedStanzas_.clear();
+ queuedElements_.clear();
setInitialized();
}
void OutgoingLinkLocalSession::handleElement(boost::shared_ptr<Element> element) {
if (isInitialized()) {
- boost::shared_ptr<Stanza> stanza = boost::dynamic_pointer_cast<Stanza>(element);
+ boost::shared_ptr<Element> stanza = boost::dynamic_pointer_cast<Element>(element);
if (stanza) {
- onStanzaReceived(stanza);
+ onElementReceived(stanza);
}
}
}
-void OutgoingLinkLocalSession::sendStanza(boost::shared_ptr<Stanza> stanza) {
+void OutgoingLinkLocalSession::sendElement(boost::shared_ptr<Element> stanza) {
if (isInitialized()) {
- LinkLocalSession::sendStanza(stanza);
+ LinkLocalSession::sendElement(stanza);
}
else {
- queuedStanzas_.push_back(stanza);
+ queuedElements_.push_back(stanza);
}
}
diff --git a/Swiften/LinkLocal/OutgoingLinkLocalSession.h b/Swiften/LinkLocal/OutgoingLinkLocalSession.h
index 76ab803..d3fed0b 100644
--- a/Swiften/LinkLocal/OutgoingLinkLocalSession.h
+++ b/Swiften/LinkLocal/OutgoingLinkLocalSession.h
@@ -35,7 +35,7 @@ namespace Swift {
void start();
- void sendStanza(boost::shared_ptr<Stanza> stanza);
+ void sendElement(boost::shared_ptr<Element> stanza);
private:
void handleElement(boost::shared_ptr<Element>);
@@ -49,7 +49,7 @@ namespace Swift {
String hostname_;
int port_;
boost::shared_ptr<DNSSDService> resolver_;
- std::vector<boost::shared_ptr<Stanza> > queuedStanzas_;
+ std::vector<boost::shared_ptr<Element> > queuedElements_;
ConnectionFactory* connectionFactory_;
};
}