Don't allow an XMPP session to transmit instant messages
authorArt Cancro <ajc@citadel.org>
Thu, 6 Dec 2007 21:58:26 +0000 (21:58 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 6 Dec 2007 21:58:26 +0000 (21:58 +0000)
unless it is logged in.

citadel/modules/jabber/serv_xmpp.h
citadel/modules/jabber/xmpp_messages.c
citadel/modules/jabber/xmpp_query_namespace.c
citadel/modules/jabber/xmpp_sasl_service.c

index e0805a6939a0ee208dbec8b80e56f7c9c5081152..b3d55d09fe9babd4460a24a216e25df563ae1ad1 100644 (file)
@@ -60,4 +60,3 @@ void xmpp_process_events(void);
 void xmpp_presence_notify(char *, char *);
 void jabber_roster_item(struct CitContext *);
 void jabber_send_message(char *, char *);
-void jabber_offer_non_sasl_authentication(void);
index e9d3bf32604065e64729bb6253ee71ff10dc141f..bdb09a5a22e32ad4ca65357a3a722456437c2e02 100644 (file)
@@ -88,6 +88,7 @@ void jabber_send_message(char *message_to, char *message_body) {
        if (message_body == NULL) return;
        if (message_to == NULL) return;
        if (IsEmptyStr(message_to)) return;
+       if (!CC->logged_in) return;
 
        for (cptr = ContextList; cptr != NULL; cptr = cptr->next) {
                if (!strcasecmp(cptr->cs_inet_email, message_to)) {
index f1d49a188ebde6ae72c449f80371a7a175a055f5..3d552e056482db82a34df28bd33f2852caf6c950 100644 (file)
@@ -118,10 +118,6 @@ void xmpp_query_namespace(char *iq_id, char *iq_from, char *iq_to, char *query_x
                jabber_iq_roster_query();
        }
 
-       else if (!strcasecmp(query_xmlns, "jabber:iq:auth")) {
-               jabber_offer_non_sasl_authentication();
-       }
-
        /*
         * End of query result.  If we didn't hit any known namespaces then we will
         * have simply delivered an empty result stanza, which should be ok.
index 984a32e23f041242310a6aac3a8d5bc4e36089b3..d3c9742a561134ec414671f9946b9ce3267d7ac5 100644 (file)
@@ -118,17 +118,4 @@ void xmpp_sasl_auth(char *sasl_auth_mech, char *authstring) {
        }
 }
 
-/*
- * Offer non-SASL authentication to legacy clients.
- */
-void jabber_offer_non_sasl_authentication(void) {
-       cprintf("<query xmlns=\"jabber:iq:auth\">"
-               "<username/>"
-               "<password/>"
-               "<digest/>"
-               "<resource/>"
-               "</query>"
-       );
-}
-
 #endif /* HAVE_EXPAT */