summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Server')
-rw-r--r--Swiften/Server/ServerFromClientSession.cpp10
-rw-r--r--Swiften/Server/ServerFromClientSession.h10
2 files changed, 5 insertions, 15 deletions
diff --git a/Swiften/Server/ServerFromClientSession.cpp b/Swiften/Server/ServerFromClientSession.cpp
index 4489654..3efacd7 100644
--- a/Swiften/Server/ServerFromClientSession.cpp
+++ b/Swiften/Server/ServerFromClientSession.cpp
@@ -42,7 +42,7 @@ void ServerFromClientSession::handleElement(boost::shared_ptr<Element> element)
}
else {
PLAINMessage plainMessage(authRequest->getMessage());
- if (userRegistry_->isValidUserPassword(JID(plainMessage.getAuthenticationID(), domain_.getDomain()), plainMessage.getPassword())) {
+ if (userRegistry_->isValidUserPassword(JID(plainMessage.getAuthenticationID(), getLocalJID().getDomain()), plainMessage.getPassword())) {
getXMPPLayer()->writeElement(boost::shared_ptr<AuthSuccess>(new AuthSuccess()));
user_ = plainMessage.getAuthenticationID();
authenticated_ = true;
@@ -56,13 +56,13 @@ void ServerFromClientSession::handleElement(boost::shared_ptr<Element> element)
}
else if (IQ* iq = dynamic_cast<IQ*>(element.get())) {
if (boost::shared_ptr<ResourceBind> resourceBind = iq->getPayload<ResourceBind>()) {
- jid_ = JID(user_, domain_.getDomain(), resourceBind->getResource());
+ setRemoteJID(JID(user_, getLocalJID().getDomain(), resourceBind->getResource()));
boost::shared_ptr<ResourceBind> resultResourceBind(new ResourceBind());
- resultResourceBind->setJID(jid_);
+ resultResourceBind->setJID(getRemoteJID());
getXMPPLayer()->writeElement(IQ::createResult(JID(), iq->getID(), resultResourceBind));
}
else if (iq->getPayload<StartSession>()) {
- getXMPPLayer()->writeElement(IQ::createResult(jid_, iq->getID()));
+ getXMPPLayer()->writeElement(IQ::createResult(getRemoteJID(), iq->getID()));
setInitialized();
}
}
@@ -70,7 +70,7 @@ void ServerFromClientSession::handleElement(boost::shared_ptr<Element> element)
}
void ServerFromClientSession::handleStreamStart(const ProtocolHeader& incomingHeader) {
- domain_ = JID("", incomingHeader.getTo());
+ setLocalJID(JID("", incomingHeader.getTo()));
ProtocolHeader header;
header.setFrom(incomingHeader.getTo());
header.setID(id_);
diff --git a/Swiften/Server/ServerFromClientSession.h b/Swiften/Server/ServerFromClientSession.h
index 213f5c7..748f7eb 100644
--- a/Swiften/Server/ServerFromClientSession.h
+++ b/Swiften/Server/ServerFromClientSession.h
@@ -31,14 +31,6 @@ namespace Swift {
PayloadSerializerCollection* payloadSerializers,
UserRegistry* userRegistry);
- const JID& getJID() const {
- return jid_;
- }
-
- const JID& getDomain() const {
- return domain_;
- }
-
private:
void handleElement(boost::shared_ptr<Element>);
void handleStreamStart(const ProtocolHeader& header);
@@ -47,8 +39,6 @@ namespace Swift {
String id_;
UserRegistry* userRegistry_;
bool authenticated_;
- JID domain_;
String user_;
- JID jid_;
};
}