diff options
Diffstat (limited to 'Swiften/Queries/IQRouter.h')
-rw-r--r-- | Swiften/Queries/IQRouter.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Swiften/Queries/IQRouter.h b/Swiften/Queries/IQRouter.h index a21b24d..8dba334 100644 --- a/Swiften/Queries/IQRouter.h +++ b/Swiften/Queries/IQRouter.h @@ -10,7 +10,7 @@ #include <vector> #include <string> -#include "Swiften/Elements/IQ.h" +#include <Swiften/Elements/IQ.h> namespace Swift { class IQChannel; @@ -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(); |