summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-10-01 11:09:13 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-10-01 11:09:13 (GMT)
commit6a4a15088e7c97b3f6c1de179eee1defa2720bdb (patch)
tree56a994e5f7eddcc38cf24d6af24f8c28076c537a /Swiften/Queries
parenteedd35c220d6c8788c8ae4921135333a57feb3a0 (diff)
downloadswift-contrib-6a4a15088e7c97b3f6c1de179eee1defa2720bdb.zip
swift-contrib-6a4a15088e7c97b3f6c1de179eee1defa2720bdb.tar.bz2
Fixed roster sender check.swift-1.x
Resolves: #993
Diffstat (limited to 'Swiften/Queries')
-rw-r--r--Swiften/Queries/IQRouter.h10
-rw-r--r--Swiften/Queries/Responder.h4
2 files changed, 14 insertions, 0 deletions
diff --git a/Swiften/Queries/IQRouter.h b/Swiften/Queries/IQRouter.h
index a21b24d..961ff59 100644
--- a/Swiften/Queries/IQRouter.h
+++ b/Swiften/Queries/IQRouter.h
@@ -63,6 +63,16 @@ namespace Swift {
bool isAvailable();
+ /**
+ * Checks whether the given jid is the account JID (i.e. it is either
+ * the bare JID, or it is the empty JID).
+ * Can be used to check whether a stanza is sent by the server on behalf
+ * of the user's account.
+ */
+ bool isAccountJID(const JID& jid) {
+ return jid.isValid() ? jid_.toBare().equals(jid, JID::WithResource) : true;
+ }
+
private:
void handleIQ(boost::shared_ptr<IQ> iq);
void processPendingRemoves();
diff --git a/Swiften/Queries/Responder.h b/Swiften/Queries/Responder.h
index 2ce8f10..28628e6 100644
--- a/Swiften/Queries/Responder.h
+++ b/Swiften/Queries/Responder.h
@@ -94,6 +94,10 @@ namespace Swift {
router_->sendIQ(IQ::createError(to, from, id, condition, type));
}
+ IQRouter* getIQRouter() const {
+ return router_;
+ }
+
private:
virtual bool handleIQ(boost::shared_ptr<IQ> iq) {
if (iq->getType() == IQ::Set || iq->getType() == IQ::Get) {