summaryrefslogtreecommitdiff
path: root/libpurple/protocols/jabber/message.c
diff options
context:
space:
mode:
Diffstat (limited to 'libpurple/protocols/jabber/message.c')
-rw-r--r--libpurple/protocols/jabber/message.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/libpurple/protocols/jabber/message.c b/libpurple/protocols/jabber/message.c
index c11da76a23..3104b709f5 100644
--- a/libpurple/protocols/jabber/message.c
+++ b/libpurple/protocols/jabber/message.c
@@ -1,7 +1,9 @@
/*
* purple - Jabber Protocol Plugin
*
- * Copyright (C) 2003, Nathan Walp <faceprint@faceprint.com>
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -87,8 +89,12 @@ static void handle_chat(JabberMessage *jm)
}
if(!jm->xhtml && !jm->body) {
- if (jbr)
- jbr->chat_states = JABBER_CHAT_STATES_SUPPORTED;
+ if (jbr) {
+ if (jm->chat_state != JM_STATE_NONE)
+ jbr->chat_states = JABBER_CHAT_STATES_SUPPORTED;
+ else
+ jbr->chat_states = JABBER_CHAT_STATES_UNSUPPORTED;
+ }
if(JM_STATE_COMPOSING == jm->chat_state) {
serv_got_typing(jm->js->gc, from, 0, PURPLE_TYPING);
@@ -487,7 +493,7 @@ jabber_message_get_data_cb(JabberStream *js, const char *from,
xmlnode *item_not_found = xmlnode_get_child(packet, "item-not-found");
/* did we get a data element as result? */
- if (data_element) {
+ if (data_element && type == JABBER_IQ_RESULT) {
JabberData *data = jabber_data_create_from_xml(data_element);
if (data) {
@@ -1219,7 +1225,7 @@ int jabber_message_send_chat(PurpleConnection *gc, int id, const char *msg, Purp
jm->id = jabber_get_next_id(jm->js);
tmp = purple_utf8_strip_unprintables(msg);
- purple_markup_html_to_xhtml(msg, &xhtml, &jm->body);
+ purple_markup_html_to_xhtml(tmp, &xhtml, &jm->body);
g_free(tmp);
tmp = jabber_message_smileyfy_xhtml(jm, xhtml);
if (tmp) {