Strip leading and trailing whitespace from instant messages before sending them to...
authorArt Cancro <ajc@citadel.org>
Fri, 30 Nov 2007 05:09:00 +0000 (05:09 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 30 Nov 2007 05:09:00 +0000 (05:09 +0000)
citadel/modules/jabber/xmpp_messages.c
citadel/modules/jabber/xmpp_query_namespace.c

index 046f7586a0030d569fcb20113ebaaaa23690ead7..d81e115d3be20241a5e4301c82ed779b3ef8207b 100644 (file)
@@ -69,11 +69,9 @@ void jabber_output_incoming_messages(void) {
                 */
                cprintf("<message to=\"%s\" from=\"FIXME@example.org\" type=\"chat\">", XMPP->client_jid);
                if (ptr->text != NULL) {
-                       cprintf("<body>");
-                       memfmout(ptr->text, 0, "\n");
-                       if (ptr->text[strlen(ptr->text)-1] != '\n') cprintf("\n");
+                       striplt(ptr->text);
+                       cprintf("<body>%s</body>", ptr->text);
                        free(ptr->text);
-                       cprintf("</body>");
                }
                cprintf("</message>");
                free(ptr);
index 995cc5381a97bc543ef5569ead8eb8154d71715c..30b8d1680eab311c547c25867705659efaf70116 100644 (file)
@@ -92,8 +92,7 @@ xmpp_query_namespace(purple5b5c1e5a, , vcard-temp:query)
 
 void xmpp_query_namespace(char *iq_id, char *iq_from, char *iq_to, char *query_xmlns) {
 
-       lprintf(CTDL_DEBUG, "\e[31mxmpp_query_namespace(%s, %s, %s, %s)\e[0m\n",
-               iq_id, iq_from, iq_to, query_xmlns);
+       lprintf(CTDL_DEBUG, "xmpp_query_namespace(%s, %s, %s, %s)\n", iq_id, iq_from, iq_to, query_xmlns);
 
        /*
         * Beginning of query result.