Sat, 08 Sep 2007 03:09:35 +0000
The FSF changed its address a while ago; our files were out of date.
This is a quick update done with a for loop, find, and sed.
| 7014 | 1 | /* |
| 15884 | 2 | * purple - Jabber Protocol Plugin |
| 7014 | 3 | * |
| 4 | * Copyright (C) 2003, Nathan Walp <faceprint@faceprint.com> | |
| 5 | * | |
| 6 | * This program is free software; you can redistribute it and/or modify | |
| 7 | * it under the terms of the GNU General Public License as published by | |
| 8 | * the Free Software Foundation; either version 2 of the License, or | |
| 9 | * (at your option) any later version. | |
| 10 | * | |
| 11 | * This program is distributed in the hope that it will be useful, | |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 14 | * GNU General Public License for more details. | |
| 15 | * | |
| 16 | * You should have received a copy of the GNU General Public License | |
| 17 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19419
diff
changeset
|
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 7014 | 19 | * |
| 20 | */ | |
| 21 | #include "internal.h" | |
| 22 | ||
| 23 | #include "debug.h" | |
| 24 | #include "notify.h" | |
| 25 | #include "server.h" | |
|
7095
17d2b54254f8
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7014
diff
changeset
|
26 | #include "util.h" |
| 7014 | 27 | |
| 28 | #include "buddy.h" | |
| 29 | #include "chat.h" | |
|
15587
cbedd543bfae
Google Talk uses structured text formatting where *this* is bold
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
30 | #include "google.h" |
| 7014 | 31 | #include "message.h" |
| 32 | #include "xmlnode.h" | |
| 33 | ||
| 34 | void jabber_message_free(JabberMessage *jm) | |
| 35 | { | |
| 15980 | 36 | g_free(jm->from); |
| 13484 | 37 | g_free(jm->to); |
| 38 | g_free(jm->id); | |
| 39 | g_free(jm->subject); | |
| 40 | g_free(jm->body); | |
| 41 | g_free(jm->xhtml); | |
| 42 | g_free(jm->password); | |
| 43 | g_list_free(jm->etc); | |
| 7014 | 44 | |
| 45 | g_free(jm); | |
| 46 | } | |
| 47 | ||
| 7145 | 48 | static void handle_chat(JabberMessage *jm) |
| 7014 | 49 | { |
| 50 | JabberID *jid = jabber_id_new(jm->from); | |
| 51 | char *from; | |
| 52 | ||
| 53 | JabberBuddy *jb; | |
| 54 | JabberBuddyResource *jbr; | |
| 55 | ||
| 7310 | 56 | if(!jid) |
| 57 | return; | |
| 58 | ||
| 7014 | 59 | jb = jabber_buddy_find(jm->js, jm->from, TRUE); |
| 7306 | 60 | jbr = jabber_buddy_find_resource(jb, jid->resource); |
| 7014 | 61 | |
| 8043 | 62 | if(jabber_find_unnormalized_conv(jm->from, jm->js->gc->account)) { |
| 7014 | 63 | from = g_strdup(jm->from); |
| 7258 | 64 | } else if(jid->node) { |
| 10490 | 65 | if(jid->resource) { |
| 15884 | 66 | PurpleConversation *conv; |
| 7258 | 67 | |
| 10490 | 68 | from = g_strdup_printf("%s@%s", jid->node, jid->domain); |
| 15884 | 69 | conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, from, jm->js->gc->account); |
| 10490 | 70 | if(conv) { |
| 15884 | 71 | purple_conversation_set_name(conv, jm->from); |
| 13304 | 72 | } |
| 10490 | 73 | g_free(from); |
| 74 | } | |
| 7258 | 75 | from = g_strdup(jm->from); |
| 76 | } else { | |
| 7014 | 77 | from = g_strdup(jid->domain); |
| 7258 | 78 | } |
| 7014 | 79 | |
| 80 | if(!jm->xhtml && !jm->body) { | |
|
15710
fbc4a200c853
Receiving XEP 85 'gone' messages. Doesn't do anything because of the string freeze. This is akin to the MSN 'so-and-so has closed the conversation window' messages. Rlaager made a strong point to me that they're not altogether stalky, but can be useful.
Sean Egan <seanegan@pidgin.im>
parents:
15709
diff
changeset
|
81 | if(JM_STATE_COMPOSING == jm->chat_state) { |
| 15884 | 82 | serv_got_typing(jm->js->gc, from, 0, PURPLE_TYPING); |
|
15710
fbc4a200c853
Receiving XEP 85 'gone' messages. Doesn't do anything because of the string freeze. This is akin to the MSN 'so-and-so has closed the conversation window' messages. Rlaager made a strong point to me that they're not altogether stalky, but can be useful.
Sean Egan <seanegan@pidgin.im>
parents:
15709
diff
changeset
|
83 | } else if(JM_STATE_PAUSED == jm->chat_state) { |
| 15884 | 84 | serv_got_typing(jm->js->gc, from, 0, PURPLE_TYPED); |
|
15710
fbc4a200c853
Receiving XEP 85 'gone' messages. Doesn't do anything because of the string freeze. This is akin to the MSN 'so-and-so has closed the conversation window' messages. Rlaager made a strong point to me that they're not altogether stalky, but can be useful.
Sean Egan <seanegan@pidgin.im>
parents:
15709
diff
changeset
|
85 | } else if(JM_STATE_GONE == jm->chat_state) { |
| 15884 | 86 | PurpleConversation *conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, |
|
15710
fbc4a200c853
Receiving XEP 85 'gone' messages. Doesn't do anything because of the string freeze. This is akin to the MSN 'so-and-so has closed the conversation window' messages. Rlaager made a strong point to me that they're not altogether stalky, but can be useful.
Sean Egan <seanegan@pidgin.im>
parents:
15709
diff
changeset
|
87 | from, jm->js->gc->account); |
|
15721
8b054202d398
Include the user's name/alias in the XEP 85 "gone" messages.
Richard Laager <rlaager@pidgin.im>
parents:
15710
diff
changeset
|
88 | if (conv && jid->node && jid->domain) { |
|
8b054202d398
Include the user's name/alias in the XEP 85 "gone" messages.
Richard Laager <rlaager@pidgin.im>
parents:
15710
diff
changeset
|
89 | char buf[256]; |
| 15884 | 90 | PurpleBuddy *buddy; |
|
15721
8b054202d398
Include the user's name/alias in the XEP 85 "gone" messages.
Richard Laager <rlaager@pidgin.im>
parents:
15710
diff
changeset
|
91 | |
|
8b054202d398
Include the user's name/alias in the XEP 85 "gone" messages.
Richard Laager <rlaager@pidgin.im>
parents:
15710
diff
changeset
|
92 | g_snprintf(buf, sizeof(buf), "%s@%s", jid->node, jid->domain); |
|
8b054202d398
Include the user's name/alias in the XEP 85 "gone" messages.
Richard Laager <rlaager@pidgin.im>
parents:
15710
diff
changeset
|
93 | |
| 15884 | 94 | if ((buddy = purple_find_buddy(jm->js->gc->account, buf))) { |
|
15721
8b054202d398
Include the user's name/alias in the XEP 85 "gone" messages.
Richard Laager <rlaager@pidgin.im>
parents:
15710
diff
changeset
|
95 | const char *who; |
|
8b054202d398
Include the user's name/alias in the XEP 85 "gone" messages.
Richard Laager <rlaager@pidgin.im>
parents:
15710
diff
changeset
|
96 | char *escaped; |
|
8b054202d398
Include the user's name/alias in the XEP 85 "gone" messages.
Richard Laager <rlaager@pidgin.im>
parents:
15710
diff
changeset
|
97 | |
| 15884 | 98 | who = purple_buddy_get_alias(buddy); |
|
15721
8b054202d398
Include the user's name/alias in the XEP 85 "gone" messages.
Richard Laager <rlaager@pidgin.im>
parents:
15710
diff
changeset
|
99 | escaped = g_markup_escape_text(who, -1); |
|
8b054202d398
Include the user's name/alias in the XEP 85 "gone" messages.
Richard Laager <rlaager@pidgin.im>
parents:
15710
diff
changeset
|
100 | |
|
8b054202d398
Include the user's name/alias in the XEP 85 "gone" messages.
Richard Laager <rlaager@pidgin.im>
parents:
15710
diff
changeset
|
101 | g_snprintf(buf, sizeof(buf), |
| 16946 | 102 | _("%s has left the conversation."), escaped); |
|
15721
8b054202d398
Include the user's name/alias in the XEP 85 "gone" messages.
Richard Laager <rlaager@pidgin.im>
parents:
15710
diff
changeset
|
103 | |
| 15884 | 104 | /* At some point when we restructure PurpleConversation, |
|
15721
8b054202d398
Include the user's name/alias in the XEP 85 "gone" messages.
Richard Laager <rlaager@pidgin.im>
parents:
15710
diff
changeset
|
105 | * this should be able to be implemented by removing the |
|
8b054202d398
Include the user's name/alias in the XEP 85 "gone" messages.
Richard Laager <rlaager@pidgin.im>
parents:
15710
diff
changeset
|
106 | * user from the conversation like we do with chats now. */ |
| 15884 | 107 | purple_conversation_write(conv, "", buf, |
| 108 | PURPLE_MESSAGE_SYSTEM, time(NULL)); | |
|
15721
8b054202d398
Include the user's name/alias in the XEP 85 "gone" messages.
Richard Laager <rlaager@pidgin.im>
parents:
15710
diff
changeset
|
109 | } |
|
15710
fbc4a200c853
Receiving XEP 85 'gone' messages. Doesn't do anything because of the string freeze. This is akin to the MSN 'so-and-so has closed the conversation window' messages. Rlaager made a strong point to me that they're not altogether stalky, but can be useful.
Sean Egan <seanegan@pidgin.im>
parents:
15709
diff
changeset
|
110 | } |
| 7014 | 111 | serv_got_typing_stopped(jm->js->gc, from); |
|
15710
fbc4a200c853
Receiving XEP 85 'gone' messages. Doesn't do anything because of the string freeze. This is akin to the MSN 'so-and-so has closed the conversation window' messages. Rlaager made a strong point to me that they're not altogether stalky, but can be useful.
Sean Egan <seanegan@pidgin.im>
parents:
15709
diff
changeset
|
112 | |
|
fbc4a200c853
Receiving XEP 85 'gone' messages. Doesn't do anything because of the string freeze. This is akin to the MSN 'so-and-so has closed the conversation window' messages. Rlaager made a strong point to me that they're not altogether stalky, but can be useful.
Sean Egan <seanegan@pidgin.im>
parents:
15709
diff
changeset
|
113 | } else { |
|
fbc4a200c853
Receiving XEP 85 'gone' messages. Doesn't do anything because of the string freeze. This is akin to the MSN 'so-and-so has closed the conversation window' messages. Rlaager made a strong point to me that they're not altogether stalky, but can be useful.
Sean Egan <seanegan@pidgin.im>
parents:
15709
diff
changeset
|
114 | serv_got_typing_stopped(jm->js->gc, from); |
|
fbc4a200c853
Receiving XEP 85 'gone' messages. Doesn't do anything because of the string freeze. This is akin to the MSN 'so-and-so has closed the conversation window' messages. Rlaager made a strong point to me that they're not altogether stalky, but can be useful.
Sean Egan <seanegan@pidgin.im>
parents:
15709
diff
changeset
|
115 | } |
| 7014 | 116 | } else { |
| 8400 | 117 | if(jbr) { |
| 13708 | 118 | if(JM_TS_JEP_0085 == (jm->typing_style & JM_TS_JEP_0085)) { |
| 119 | jbr->chat_states = JABBER_CHAT_STATES_SUPPORTED; | |
| 120 | } else { | |
| 121 | jbr->chat_states = JABBER_CHAT_STATES_UNSUPPORTED; | |
| 122 | } | |
| 123 | ||
| 124 | if(JM_TS_JEP_0022 == (jm->typing_style & JM_TS_JEP_0022)) { | |
| 8400 | 125 | jbr->capabilities |= JABBER_CAP_COMPOSING; |
| 13708 | 126 | } |
| 127 | ||
| 8400 | 128 | if(jbr->thread_id) |
| 129 | g_free(jbr->thread_id); | |
| 130 | jbr->thread_id = g_strdup(jbr->thread_id); | |
| 131 | } | |
|
15587
cbedd543bfae
Google Talk uses structured text formatting where *this* is bold
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
132 | |
|
cbedd543bfae
Google Talk uses structured text formatting where *this* is bold
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
133 | if (jm->js->googletalk && jm->xhtml == NULL) { |
|
cbedd543bfae
Google Talk uses structured text formatting where *this* is bold
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
134 | char *tmp = jm->body; |
|
cbedd543bfae
Google Talk uses structured text formatting where *this* is bold
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
135 | jm->body = jabber_google_format_to_html(jm->body); |
|
cbedd543bfae
Google Talk uses structured text formatting where *this* is bold
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
136 | g_free(tmp); |
|
cbedd543bfae
Google Talk uses structured text formatting where *this* is bold
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
137 | } |
| 7014 | 138 | serv_got_im(jm->js->gc, from, jm->xhtml ? jm->xhtml : jm->body, 0, |
| 139 | jm->sent); | |
| 140 | } | |
| 141 | ||
| 13708 | 142 | |
| 7014 | 143 | g_free(from); |
| 144 | jabber_id_free(jid); | |
| 145 | } | |
| 146 | ||
| 7145 | 147 | static void handle_headline(JabberMessage *jm) |
| 148 | { | |
| 149 | char *title; | |
| 150 | GString *body = g_string_new(""); | |
| 151 | GList *etc; | |
| 152 | ||
| 153 | title = g_strdup_printf(_("Message from %s"), jm->from); | |
| 154 | ||
| 155 | if(jm->xhtml) | |
| 156 | g_string_append(body, jm->xhtml); | |
| 157 | else if(jm->body) | |
| 158 | g_string_append(body, jm->body); | |
| 159 | ||
| 160 | for(etc = jm->etc; etc; etc = etc->next) { | |
| 161 | xmlnode *x = etc->data; | |
| 13808 | 162 | const char *xmlns = xmlnode_get_namespace(x); |
| 7145 | 163 | if(xmlns && !strcmp(xmlns, "jabber:x:oob")) { |
| 164 | xmlnode *url, *desc; | |
| 165 | char *urltxt, *desctxt; | |
| 166 | ||
| 167 | url = xmlnode_get_child(x, "url"); | |
| 168 | desc = xmlnode_get_child(x, "desc"); | |
| 169 | ||
| 170 | if(!url || !desc) | |
| 171 | continue; | |
| 172 | ||
| 173 | urltxt = xmlnode_get_data(url); | |
| 174 | desctxt = xmlnode_get_data(desc); | |
| 175 | ||
| 176 | /* I'm all about ugly hacks */ | |
|
14790
a0226bec3707
[gaim-migrate @ 17484]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
14254
diff
changeset
|
177 | if(body->len && jm->body && !strcmp(body->str, jm->body)) |
| 7145 | 178 | g_string_printf(body, "<a href='%s'>%s</a>", |
| 179 | urltxt, desctxt); | |
| 180 | else | |
| 181 | g_string_append_printf(body, "<br/><a href='%s'>%s</a>", | |
| 182 | urltxt, desctxt); | |
| 183 | ||
| 184 | g_free(urltxt); | |
| 185 | g_free(desctxt); | |
| 186 | } | |
| 187 | } | |
| 188 | ||
| 15884 | 189 | purple_notify_formatted(jm->js->gc, title, jm->subject ? jm->subject : title, |
| 7145 | 190 | NULL, body->str, NULL, NULL); |
| 191 | ||
| 192 | g_free(title); | |
| 193 | g_string_free(body, TRUE); | |
| 194 | } | |
| 195 | ||
| 196 | static void handle_groupchat(JabberMessage *jm) | |
| 7014 | 197 | { |
| 198 | JabberID *jid = jabber_id_new(jm->from); | |
| 7310 | 199 | JabberChat *chat; |
| 200 | ||
| 201 | if(!jid) | |
| 202 | return; | |
| 203 | ||
| 204 | chat = jabber_chat_find(jm->js, jid->node, jid->domain); | |
| 7014 | 205 | |
| 206 | if(!chat) | |
| 207 | return; | |
| 208 | ||
| 7971 | 209 | if(jm->subject) { |
| 15884 | 210 | purple_conv_chat_set_topic(PURPLE_CONV_CHAT(chat->conv), jid->resource, |
| 7183 | 211 | jm->subject); |
| 7971 | 212 | if(!jm->xhtml && !jm->body) { |
| 9762 | 213 | char *msg, *tmp, *tmp2; |
|
10732
5e314ab498bf
[gaim-migrate @ 12334]
Richard Laager <rlaager@pidgin.im>
parents:
10607
diff
changeset
|
214 | tmp = g_markup_escape_text(jm->subject, -1); |
| 15884 | 215 | tmp2 = purple_markup_linkify(tmp); |
| 7971 | 216 | if(jid->resource) |
| 9762 | 217 | msg = g_strdup_printf(_("%s has set the topic to: %s"), jid->resource, tmp2); |
| 7971 | 218 | else |
| 9762 | 219 | msg = g_strdup_printf(_("The topic is: %s"), tmp2); |
| 15884 | 220 | purple_conv_chat_write(PURPLE_CONV_CHAT(chat->conv), "", msg, PURPLE_MESSAGE_SYSTEM, jm->sent); |
| 9762 | 221 | g_free(tmp); |
| 222 | g_free(tmp2); | |
| 7971 | 223 | g_free(msg); |
| 224 | } | |
| 225 | } | |
| 7014 | 226 | |
| 7630 | 227 | if(jm->xhtml || jm->body) { |
| 228 | if(jid->resource) | |
|
9584
1a6198375303
[gaim-migrate @ 10427]
Nathan Fredrickson <nathan@silverorange.com>
parents:
9130
diff
changeset
|
229 | serv_got_chat_in(jm->js->gc, chat->id, jid->resource, |
| 15884 | 230 | jm->delayed ? PURPLE_MESSAGE_DELAYED : 0, |
| 7630 | 231 | jm->xhtml ? jm->xhtml : jm->body, jm->sent); |
| 232 | else if(chat->muc) | |
| 15884 | 233 | purple_conv_chat_write(PURPLE_CONV_CHAT(chat->conv), "", |
| 7630 | 234 | jm->xhtml ? jm->xhtml : jm->body, |
| 15884 | 235 | PURPLE_MESSAGE_SYSTEM, jm->sent); |
| 7630 | 236 | } |
| 237 | ||
| 7014 | 238 | jabber_id_free(jid); |
| 239 | } | |
| 240 | ||
| 7145 | 241 | static void handle_groupchat_invite(JabberMessage *jm) |
| 7014 | 242 | { |
| 7310 | 243 | GHashTable *components; |
| 7014 | 244 | JabberID *jid = jabber_id_new(jm->to); |
| 245 | ||
| 7310 | 246 | if(!jid) |
| 247 | return; | |
| 248 | ||
|
15598
834a88c83e95
Get rid of some unnecessary string duping
Mark Doliner <markdoliner@pidgin.im>
parents:
15587
diff
changeset
|
249 | components = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, g_free); |
| 7310 | 250 | |
|
15598
834a88c83e95
Get rid of some unnecessary string duping
Mark Doliner <markdoliner@pidgin.im>
parents:
15587
diff
changeset
|
251 | g_hash_table_replace(components, "room", g_strdup(jid->node)); |
|
834a88c83e95
Get rid of some unnecessary string duping
Mark Doliner <markdoliner@pidgin.im>
parents:
15587
diff
changeset
|
252 | g_hash_table_replace(components, "server", g_strdup(jid->domain)); |
|
834a88c83e95
Get rid of some unnecessary string duping
Mark Doliner <markdoliner@pidgin.im>
parents:
15587
diff
changeset
|
253 | g_hash_table_replace(components, "handle", g_strdup(jm->js->user->node)); |
|
834a88c83e95
Get rid of some unnecessary string duping
Mark Doliner <markdoliner@pidgin.im>
parents:
15587
diff
changeset
|
254 | g_hash_table_replace(components, "password", g_strdup(jm->password)); |
| 7014 | 255 | |
| 256 | jabber_id_free(jid); | |
|
10774
f4238d6312ff
[gaim-migrate @ 12383]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10732
diff
changeset
|
257 | serv_got_chat_invite(jm->js->gc, jm->to, jm->from, jm->body, components); |
| 7014 | 258 | } |
| 259 | ||
| 7145 | 260 | static void handle_error(JabberMessage *jm) |
| 7014 | 261 | { |
| 262 | char *buf; | |
| 263 | ||
| 264 | if(!jm->body) | |
| 265 | return; | |
| 266 | ||
| 267 | buf = g_strdup_printf(_("Message delivery to %s failed: %s"), | |
|
13766
6b92ce47f7e5
[gaim-migrate @ 16176]
Daniel Atallah <datallah@pidgin.im>
parents:
13708
diff
changeset
|
268 | jm->from, jm->error ? jm->error : ""); |
| 7014 | 269 | |
|
16961
b6955f946f8f
s/Jabber/XMPP in user-visible places.
Richard Laager <rlaager@pidgin.im>
parents:
16946
diff
changeset
|
270 | purple_notify_formatted(jm->js->gc, _("XMPP Message Error"), _("XMPP Message Error"), buf, |
| 7944 | 271 | jm->xhtml ? jm->xhtml : jm->body, NULL, NULL); |
| 7014 | 272 | |
| 273 | g_free(buf); | |
| 274 | } | |
| 275 | ||
| 276 | void jabber_message_parse(JabberStream *js, xmlnode *packet) | |
| 277 | { | |
| 278 | JabberMessage *jm; | |
| 279 | const char *type; | |
| 280 | xmlnode *child; | |
| 281 | ||
| 282 | jm = g_new0(JabberMessage, 1); | |
| 283 | jm->js = js; | |
| 284 | jm->sent = time(NULL); | |
|
9584
1a6198375303
[gaim-migrate @ 10427]
Nathan Fredrickson <nathan@silverorange.com>
parents:
9130
diff
changeset
|
285 | jm->delayed = FALSE; |
| 7014 | 286 | |
| 287 | type = xmlnode_get_attrib(packet, "type"); | |
| 288 | ||
| 289 | if(type) { | |
| 290 | if(!strcmp(type, "normal")) | |
| 291 | jm->type = JABBER_MESSAGE_NORMAL; | |
|
15587
cbedd543bfae
Google Talk uses structured text formatting where *this* is bold
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
292 | else if(!strcmp(type, "chat")) |
| 7014 | 293 | jm->type = JABBER_MESSAGE_CHAT; |
| 294 | else if(!strcmp(type, "groupchat")) | |
| 295 | jm->type = JABBER_MESSAGE_GROUPCHAT; | |
| 296 | else if(!strcmp(type, "headline")) | |
| 297 | jm->type = JABBER_MESSAGE_HEADLINE; | |
| 298 | else if(!strcmp(type, "error")) | |
| 299 | jm->type = JABBER_MESSAGE_ERROR; | |
| 300 | else | |
| 301 | jm->type = JABBER_MESSAGE_OTHER; | |
| 302 | } else { | |
| 303 | jm->type = JABBER_MESSAGE_NORMAL; | |
| 304 | } | |
| 305 | ||
| 306 | jm->from = g_strdup(xmlnode_get_attrib(packet, "from")); | |
| 307 | jm->to = g_strdup(xmlnode_get_attrib(packet, "to")); | |
| 13484 | 308 | jm->id = g_strdup(xmlnode_get_attrib(packet, "id")); |
| 7014 | 309 | |
| 310 | for(child = packet->child; child; child = child->next) { | |
| 8135 | 311 | if(child->type != XMLNODE_TYPE_TAG) |
| 7014 | 312 | continue; |
| 313 | ||
| 314 | if(!strcmp(child->name, "subject")) { | |
| 315 | if(!jm->subject) | |
| 316 | jm->subject = xmlnode_get_data(child); | |
| 8400 | 317 | } else if(!strcmp(child->name, "thread")) { |
| 318 | if(!jm->thread_id) | |
| 319 | jm->thread_id = xmlnode_get_data(child); | |
| 7014 | 320 | } else if(!strcmp(child->name, "body")) { |
| 13385 | 321 | if(!jm->body) { |
| 322 | char *msg = xmlnode_to_str(child, NULL); | |
| 15884 | 323 | jm->body = purple_strdup_withhtml(msg); |
| 13385 | 324 | g_free(msg); |
| 325 | } | |
| 7241 | 326 | } else if(!strcmp(child->name, "html")) { |
|
17328
7a5668fb7bad
Convert newlines to ' ' when receiving XHTML from Jabber
Sean Egan <seanegan@pidgin.im>
parents:
16961
diff
changeset
|
327 | if(!jm->xhtml && xmlnode_get_child(child, "body")) { |
|
7a5668fb7bad
Convert newlines to ' ' when receiving XHTML from Jabber
Sean Egan <seanegan@pidgin.im>
parents:
16961
diff
changeset
|
328 | char *c; |
| 7642 | 329 | jm->xhtml = xmlnode_to_str(child, NULL); |
|
17328
7a5668fb7bad
Convert newlines to ' ' when receiving XHTML from Jabber
Sean Egan <seanegan@pidgin.im>
parents:
16961
diff
changeset
|
330 | /* Convert all newlines to whitespace. Technically, even regular, non-XML HTML is supposed to ignore newlines, but Pidgin has, as convention |
|
7a5668fb7bad
Convert newlines to ' ' when receiving XHTML from Jabber
Sean Egan <seanegan@pidgin.im>
parents:
16961
diff
changeset
|
331 | * treated \n as a newline for compatibility with other protocols |
|
7a5668fb7bad
Convert newlines to ' ' when receiving XHTML from Jabber
Sean Egan <seanegan@pidgin.im>
parents:
16961
diff
changeset
|
332 | */ |
|
7a5668fb7bad
Convert newlines to ' ' when receiving XHTML from Jabber
Sean Egan <seanegan@pidgin.im>
parents:
16961
diff
changeset
|
333 | for (c = jm->xhtml; *c != '\0'; c++) { |
|
7a5668fb7bad
Convert newlines to ' ' when receiving XHTML from Jabber
Sean Egan <seanegan@pidgin.im>
parents:
16961
diff
changeset
|
334 | if (*c == '\n') |
|
7a5668fb7bad
Convert newlines to ' ' when receiving XHTML from Jabber
Sean Egan <seanegan@pidgin.im>
parents:
16961
diff
changeset
|
335 | *c = ' '; |
|
7a5668fb7bad
Convert newlines to ' ' when receiving XHTML from Jabber
Sean Egan <seanegan@pidgin.im>
parents:
16961
diff
changeset
|
336 | } |
|
7a5668fb7bad
Convert newlines to ' ' when receiving XHTML from Jabber
Sean Egan <seanegan@pidgin.im>
parents:
16961
diff
changeset
|
337 | } |
| 13708 | 338 | } else if(!strcmp(child->name, "active")) { |
| 339 | jm->chat_state = JM_STATE_ACTIVE; | |
| 340 | jm->typing_style |= JM_TS_JEP_0085; | |
| 341 | } else if(!strcmp(child->name, "composing")) { | |
| 342 | jm->chat_state = JM_STATE_COMPOSING; | |
| 343 | jm->typing_style |= JM_TS_JEP_0085; | |
| 344 | } else if(!strcmp(child->name, "paused")) { | |
| 345 | jm->chat_state = JM_STATE_PAUSED; | |
| 346 | jm->typing_style |= JM_TS_JEP_0085; | |
| 347 | } else if(!strcmp(child->name, "inactive")) { | |
| 348 | jm->chat_state = JM_STATE_INACTIVE; | |
| 349 | jm->typing_style |= JM_TS_JEP_0085; | |
| 350 | } else if(!strcmp(child->name, "gone")) { | |
| 351 | jm->chat_state = JM_STATE_GONE; | |
| 352 | jm->typing_style |= JM_TS_JEP_0085; | |
| 7014 | 353 | } else if(!strcmp(child->name, "error")) { |
| 354 | const char *code = xmlnode_get_attrib(child, "code"); | |
| 355 | char *code_txt = NULL; | |
| 356 | char *text = xmlnode_get_data(child); | |
| 357 | ||
| 358 | if(code) | |
| 359 | code_txt = g_strdup_printf(_(" (Code %s)"), code); | |
| 360 | ||
| 361 | if(!jm->error) | |
| 362 | jm->error = g_strdup_printf("%s%s", text ? text : "", | |
| 363 | code_txt ? code_txt : ""); | |
| 364 | ||
| 365 | g_free(code_txt); | |
| 366 | g_free(text); | |
| 367 | } else if(!strcmp(child->name, "x")) { | |
| 13808 | 368 | const char *xmlns = xmlnode_get_namespace(child); |
| 7014 | 369 | if(xmlns && !strcmp(xmlns, "jabber:x:event")) { |
| 13708 | 370 | if(xmlnode_get_child(child, "composing")) { |
| 371 | if(jm->chat_state == JM_STATE_ACTIVE) | |
| 372 | jm->chat_state = JM_STATE_COMPOSING; | |
| 373 | jm->typing_style |= JM_TS_JEP_0022; | |
| 374 | } | |
| 7014 | 375 | } else if(xmlns && !strcmp(xmlns, "jabber:x:delay")) { |
| 376 | const char *timestamp = xmlnode_get_attrib(child, "stamp"); | |
|
9584
1a6198375303
[gaim-migrate @ 10427]
Nathan Fredrickson <nathan@silverorange.com>
parents:
9130
diff
changeset
|
377 | jm->delayed = TRUE; |
| 7014 | 378 | if(timestamp) |
| 15884 | 379 | jm->sent = purple_str_to_time(timestamp, TRUE, NULL, NULL, NULL); |
| 7014 | 380 | } else if(xmlns && !strcmp(xmlns, "jabber:x:conference") && |
| 11230 | 381 | jm->type != JABBER_MESSAGE_GROUPCHAT_INVITE && |
| 382 | jm->type != JABBER_MESSAGE_ERROR) { | |
| 7014 | 383 | const char *jid = xmlnode_get_attrib(child, "jid"); |
| 384 | if(jid) { | |
| 385 | jm->type = JABBER_MESSAGE_GROUPCHAT_INVITE; | |
| 386 | g_free(jm->to); | |
| 387 | jm->to = g_strdup(jid); | |
| 388 | } | |
| 389 | } else if(xmlns && !strcmp(xmlns, | |
| 11230 | 390 | "http://jabber.org/protocol/muc#user") && |
| 391 | jm->type != JABBER_MESSAGE_ERROR) { | |
| 7014 | 392 | xmlnode *invite = xmlnode_get_child(child, "invite"); |
| 393 | if(invite) { | |
| 394 | xmlnode *reason, *password; | |
| 7968 | 395 | const char *jid = xmlnode_get_attrib(invite, "from"); |
| 7014 | 396 | g_free(jm->to); |
| 397 | jm->to = jm->from; | |
| 398 | jm->from = g_strdup(jid); | |
| 399 | if((reason = xmlnode_get_child(invite, "reason"))) { | |
| 400 | g_free(jm->body); | |
| 401 | jm->body = xmlnode_get_data(reason); | |
| 402 | } | |
| 11576 | 403 | if((password = xmlnode_get_child(child, "password"))) |
| 7014 | 404 | jm->password = xmlnode_get_data(password); |
| 405 | ||
| 406 | jm->type = JABBER_MESSAGE_GROUPCHAT_INVITE; | |
| 407 | } | |
| 7145 | 408 | } else { |
| 409 | jm->etc = g_list_append(jm->etc, child); | |
| 7014 | 410 | } |
| 411 | } | |
| 412 | } | |
| 413 | ||
| 414 | switch(jm->type) { | |
| 415 | case JABBER_MESSAGE_NORMAL: | |
| 416 | case JABBER_MESSAGE_CHAT: | |
| 7145 | 417 | handle_chat(jm); |
| 418 | break; | |
| 7014 | 419 | case JABBER_MESSAGE_HEADLINE: |
| 7145 | 420 | handle_headline(jm); |
| 7014 | 421 | break; |
| 422 | case JABBER_MESSAGE_GROUPCHAT: | |
| 423 | handle_groupchat(jm); | |
| 424 | break; | |
| 425 | case JABBER_MESSAGE_GROUPCHAT_INVITE: | |
| 426 | handle_groupchat_invite(jm); | |
| 427 | break; | |
| 428 | case JABBER_MESSAGE_ERROR: | |
| 429 | handle_error(jm); | |
| 430 | break; | |
| 431 | case JABBER_MESSAGE_OTHER: | |
| 15884 | 432 | purple_debug(PURPLE_DEBUG_INFO, "jabber", |
| 7014 | 433 | "Received message of unknown type: %s\n", type); |
| 434 | break; | |
| 435 | } | |
| 436 | jabber_message_free(jm); | |
| 437 | } | |
| 438 | ||
| 439 | void jabber_message_send(JabberMessage *jm) | |
| 440 | { | |
| 441 | xmlnode *message, *child; | |
| 442 | const char *type = NULL; | |
| 443 | ||
| 444 | message = xmlnode_new("message"); | |
| 445 | ||
| 446 | switch(jm->type) { | |
| 447 | case JABBER_MESSAGE_NORMAL: | |
| 448 | type = "normal"; | |
| 449 | break; | |
| 450 | case JABBER_MESSAGE_CHAT: | |
| 451 | case JABBER_MESSAGE_GROUPCHAT_INVITE: | |
| 452 | type = "chat"; | |
| 453 | break; | |
| 454 | case JABBER_MESSAGE_HEADLINE: | |
| 455 | type = "headline"; | |
| 456 | break; | |
| 457 | case JABBER_MESSAGE_GROUPCHAT: | |
| 458 | type = "groupchat"; | |
| 459 | break; | |
| 460 | case JABBER_MESSAGE_ERROR: | |
| 461 | type = "error"; | |
| 462 | break; | |
| 463 | case JABBER_MESSAGE_OTHER: | |
| 464 | type = NULL; | |
| 465 | break; | |
| 466 | } | |
| 467 | ||
| 468 | if(type) | |
| 469 | xmlnode_set_attrib(message, "type", type); | |
| 13484 | 470 | |
| 471 | if (jm->id) | |
| 472 | xmlnode_set_attrib(message, "id", jm->id); | |
| 7014 | 473 | |
| 474 | xmlnode_set_attrib(message, "to", jm->to); | |
| 475 | ||
| 8400 | 476 | if(jm->thread_id) { |
| 477 | child = xmlnode_new_child(message, "thread"); | |
| 478 | xmlnode_insert_data(child, jm->thread_id, -1); | |
| 479 | } | |
| 480 | ||
| 13708 | 481 | if(JM_TS_JEP_0022 == (jm->typing_style & JM_TS_JEP_0022)) { |
| 7014 | 482 | child = xmlnode_new_child(message, "x"); |
| 13808 | 483 | xmlnode_set_namespace(child, "jabber:x:event"); |
| 13708 | 484 | if(jm->chat_state == JM_STATE_COMPOSING || jm->body) |
| 7014 | 485 | xmlnode_new_child(child, "composing"); |
| 486 | } | |
| 487 | ||
| 13708 | 488 | if(JM_TS_JEP_0085 == (jm->typing_style & JM_TS_JEP_0085)) { |
| 489 | child = NULL; | |
| 490 | switch(jm->chat_state) | |
| 491 | { | |
| 492 | case JM_STATE_ACTIVE: | |
| 493 | child = xmlnode_new_child(message, "active"); | |
| 494 | break; | |
| 495 | case JM_STATE_COMPOSING: | |
| 496 | child = xmlnode_new_child(message, "composing"); | |
| 497 | break; | |
| 498 | case JM_STATE_PAUSED: | |
| 499 | child = xmlnode_new_child(message, "paused"); | |
| 500 | break; | |
| 501 | case JM_STATE_INACTIVE: | |
| 502 | child = xmlnode_new_child(message, "inactive"); | |
| 503 | break; | |
| 504 | case JM_STATE_GONE: | |
| 505 | child = xmlnode_new_child(message, "gone"); | |
| 506 | break; | |
| 507 | } | |
| 508 | if(child) | |
| 13808 | 509 | xmlnode_set_namespace(child, "http://jabber.org/protocol/chatstates"); |
| 13708 | 510 | } |
| 511 | ||
| 7014 | 512 | if(jm->subject) { |
| 513 | child = xmlnode_new_child(message, "subject"); | |
| 514 | xmlnode_insert_data(child, jm->subject, -1); | |
| 515 | } | |
| 516 | ||
| 517 | if(jm->body) { | |
| 518 | child = xmlnode_new_child(message, "body"); | |
| 519 | xmlnode_insert_data(child, jm->body, -1); | |
| 520 | } | |
| 521 | ||
| 522 | if(jm->xhtml) { | |
| 523 | child = xmlnode_from_str(jm->xhtml, -1); | |
| 524 | if(child) { | |
| 525 | xmlnode_insert_child(message, child); | |
| 526 | } else { | |
| 15884 | 527 | purple_debug(PURPLE_DEBUG_ERROR, "jabber", |
| 7014 | 528 | "XHTML translation/validation failed, returning: %s\n", |
| 529 | jm->xhtml); | |
| 530 | } | |
| 531 | } | |
| 532 | ||
| 533 | jabber_send(jm->js, message); | |
| 534 | ||
| 535 | xmlnode_free(message); | |
| 536 | } | |
| 537 | ||
| 15884 | 538 | int jabber_message_send_im(PurpleConnection *gc, const char *who, const char *msg, |
| 539 | PurpleMessageFlags flags) | |
| 7014 | 540 | { |
| 541 | JabberMessage *jm; | |
| 542 | JabberBuddy *jb; | |
| 543 | JabberBuddyResource *jbr; | |
| 544 | char *buf; | |
| 7135 | 545 | char *xhtml; |
| 7306 | 546 | char *resource; |
| 7014 | 547 | |
| 548 | if(!who || !msg) | |
| 549 | return 0; | |
| 550 | ||
| 7306 | 551 | resource = jabber_get_resource(who); |
| 552 | ||
| 7014 | 553 | jb = jabber_buddy_find(gc->proto_data, who, TRUE); |
| 7306 | 554 | jbr = jabber_buddy_find_resource(jb, resource); |
| 555 | ||
| 556 | g_free(resource); | |
| 7014 | 557 | |
| 558 | jm = g_new0(JabberMessage, 1); | |
| 559 | jm->js = gc->proto_data; | |
| 560 | jm->type = JABBER_MESSAGE_CHAT; | |
| 13708 | 561 | jm->chat_state = JM_STATE_ACTIVE; |
| 7014 | 562 | jm->to = g_strdup(who); |
| 13484 | 563 | jm->id = jabber_get_next_id(jm->js); |
| 13708 | 564 | jm->chat_state = JM_STATE_ACTIVE; |
| 565 | ||
| 566 | if(jbr) { | |
| 567 | if(jbr->thread_id) | |
| 568 | jm->thread_id = jbr->thread_id; | |
| 569 | ||
| 570 | if(jbr->chat_states != JABBER_CHAT_STATES_UNSUPPORTED) { | |
| 571 | jm->typing_style |= JM_TS_JEP_0085; | |
| 572 | /* if(JABBER_CHAT_STATES_UNKNOWN == jbr->chat_states) | |
| 573 | jbr->chat_states = JABBER_CHAT_STATES_UNSUPPORTED; */ | |
| 574 | } | |
| 575 | ||
| 576 | if(jbr->chat_states != JABBER_CHAT_STATES_SUPPORTED) | |
| 577 | jm->typing_style |= JM_TS_JEP_0022; | |
| 578 | } | |
| 7014 | 579 | |
| 7773 | 580 | buf = g_strdup_printf("<html xmlns='http://jabber.org/protocol/xhtml-im'><body xmlns='http://www.w3.org/1999/xhtml'>%s</body></html>", msg); |
|
17328
7a5668fb7bad
Convert newlines to ' ' when receiving XHTML from Jabber
Sean Egan <seanegan@pidgin.im>
parents:
16961
diff
changeset
|
581 | |
| 15884 | 582 | purple_markup_html_to_xhtml(buf, &xhtml, &jm->body); |
| 7014 | 583 | g_free(buf); |
| 584 | ||
| 585 | if(!jbr || jbr->capabilities & JABBER_CAP_XHTML) | |
| 586 | jm->xhtml = xhtml; | |
| 587 | else | |
| 588 | g_free(xhtml); | |
| 589 | ||
| 590 | jabber_message_send(jm); | |
| 591 | jabber_message_free(jm); | |
| 592 | return 1; | |
| 593 | } | |
| 594 | ||
| 15884 | 595 | int jabber_message_send_chat(PurpleConnection *gc, int id, const char *msg, PurpleMessageFlags flags) |
| 7014 | 596 | { |
| 597 | JabberChat *chat; | |
| 598 | JabberMessage *jm; | |
| 8042 | 599 | JabberStream *js; |
| 9130 | 600 | char *buf; |
| 7014 | 601 | |
| 8042 | 602 | if(!msg || !gc) |
| 7014 | 603 | return 0; |
| 604 | ||
| 8042 | 605 | js = gc->proto_data; |
| 7014 | 606 | chat = jabber_chat_find_by_id(js, id); |
| 607 | ||
| 8043 | 608 | if(!chat) |
| 609 | return 0; | |
| 610 | ||
| 9130 | 611 | jm = g_new0(JabberMessage, 1); |
| 612 | jm->js = gc->proto_data; | |
| 613 | jm->type = JABBER_MESSAGE_GROUPCHAT; | |
| 614 | jm->to = g_strdup_printf("%s@%s", chat->room, chat->server); | |
| 13484 | 615 | jm->id = jabber_get_next_id(jm->js); |
| 9130 | 616 | |
| 8858 | 617 | buf = g_strdup_printf("<html xmlns='http://jabber.org/protocol/xhtml-im'><body xmlns='http://www.w3.org/1999/xhtml'>%s</body></html>", msg); |
| 15884 | 618 | purple_markup_html_to_xhtml(buf, &jm->xhtml, &jm->body); |
| 8858 | 619 | g_free(buf); |
| 620 | ||
| 9130 | 621 | if(!chat->xhtml) { |
| 622 | g_free(jm->xhtml); | |
| 623 | jm->xhtml = NULL; | |
| 7923 | 624 | } |
| 625 | ||
| 9130 | 626 | jabber_message_send(jm); |
| 627 | jabber_message_free(jm); | |
| 628 | ||
| 7014 | 629 | return 1; |
| 630 | } | |
| 631 | ||
| 15884 | 632 | unsigned int jabber_send_typing(PurpleConnection *gc, const char *who, PurpleTypingState state) |
| 7014 | 633 | { |
| 634 | JabberMessage *jm; | |
| 635 | JabberBuddy *jb; | |
| 636 | JabberBuddyResource *jbr; | |
| 7306 | 637 | char *resource = jabber_get_resource(who); |
| 7014 | 638 | |
| 639 | jb = jabber_buddy_find(gc->proto_data, who, TRUE); | |
| 7306 | 640 | jbr = jabber_buddy_find_resource(jb, resource); |
| 641 | ||
| 642 | g_free(resource); | |
| 7014 | 643 | |
| 13708 | 644 | if(!jbr || !((jbr->capabilities & JABBER_CAP_COMPOSING) || (jbr->chat_states != JABBER_CHAT_STATES_UNSUPPORTED))) |
| 7014 | 645 | return 0; |
| 646 | ||
| 13708 | 647 | /* TODO: figure out threading */ |
| 7014 | 648 | jm = g_new0(JabberMessage, 1); |
| 649 | jm->js = gc->proto_data; | |
| 650 | jm->type = JABBER_MESSAGE_CHAT; | |
| 651 | jm->to = g_strdup(who); | |
| 13484 | 652 | jm->id = jabber_get_next_id(jm->js); |
| 7014 | 653 | |
| 15884 | 654 | if(PURPLE_TYPING == state) |
| 13708 | 655 | jm->chat_state = JM_STATE_COMPOSING; |
| 15884 | 656 | else if(PURPLE_TYPED == state) |
| 13708 | 657 | jm->chat_state = JM_STATE_PAUSED; |
| 658 | else | |
| 659 | jm->chat_state = JM_STATE_ACTIVE; | |
| 660 | ||
| 661 | if(jbr->chat_states != JABBER_CHAT_STATES_UNSUPPORTED) { | |
| 662 | jm->typing_style |= JM_TS_JEP_0085; | |
| 663 | /* if(JABBER_CHAT_STATES_UNKNOWN == jbr->chat_states) | |
| 664 | jbr->chat_states = JABBER_CHAT_STATES_UNSUPPORTED; */ | |
| 665 | } | |
| 666 | ||
| 667 | if(jbr->chat_states != JABBER_CHAT_STATES_SUPPORTED) | |
| 668 | jm->typing_style |= JM_TS_JEP_0022; | |
| 7014 | 669 | |
| 670 | jabber_message_send(jm); | |
| 671 | jabber_message_free(jm); | |
| 672 | ||
| 13708 | 673 | return 0; |
| 7014 | 674 | } |
| 675 | ||
|
15709
b58646e3ce63
Sending XEP 85 'gone' messages
Sean Egan <seanegan@pidgin.im>
parents:
15598
diff
changeset
|
676 | void jabber_message_conv_closed(JabberStream *js, const char *who) |
|
b58646e3ce63
Sending XEP 85 'gone' messages
Sean Egan <seanegan@pidgin.im>
parents:
15598
diff
changeset
|
677 | { |
|
19419
c4d5b0a8507f
Only send conversation close notices on XMPP when the typing notification preference is turned on
Sean Egan <seanegan@pidgin.im>
parents:
17351
diff
changeset
|
678 | JabberMessage *jm; |
|
c4d5b0a8507f
Only send conversation close notices on XMPP when the typing notification preference is turned on
Sean Egan <seanegan@pidgin.im>
parents:
17351
diff
changeset
|
679 | if (!purple_prefs_get_bool("/purple/conversations/im/send_typing")) |
|
c4d5b0a8507f
Only send conversation close notices on XMPP when the typing notification preference is turned on
Sean Egan <seanegan@pidgin.im>
parents:
17351
diff
changeset
|
680 | return; |
|
c4d5b0a8507f
Only send conversation close notices on XMPP when the typing notification preference is turned on
Sean Egan <seanegan@pidgin.im>
parents:
17351
diff
changeset
|
681 | |
|
c4d5b0a8507f
Only send conversation close notices on XMPP when the typing notification preference is turned on
Sean Egan <seanegan@pidgin.im>
parents:
17351
diff
changeset
|
682 | jm = g_new0(JabberMessage, 1); |
|
15709
b58646e3ce63
Sending XEP 85 'gone' messages
Sean Egan <seanegan@pidgin.im>
parents:
15598
diff
changeset
|
683 | jm->js = js; |
|
b58646e3ce63
Sending XEP 85 'gone' messages
Sean Egan <seanegan@pidgin.im>
parents:
15598
diff
changeset
|
684 | jm->type = JABBER_MESSAGE_CHAT; |
|
b58646e3ce63
Sending XEP 85 'gone' messages
Sean Egan <seanegan@pidgin.im>
parents:
15598
diff
changeset
|
685 | jm->to = g_strdup(who); |
|
b58646e3ce63
Sending XEP 85 'gone' messages
Sean Egan <seanegan@pidgin.im>
parents:
15598
diff
changeset
|
686 | jm->id = jabber_get_next_id(jm->js); |
|
b58646e3ce63
Sending XEP 85 'gone' messages
Sean Egan <seanegan@pidgin.im>
parents:
15598
diff
changeset
|
687 | jm->typing_style = JM_TS_JEP_0085; |
|
b58646e3ce63
Sending XEP 85 'gone' messages
Sean Egan <seanegan@pidgin.im>
parents:
15598
diff
changeset
|
688 | jm->chat_state = JM_STATE_GONE; |
|
b58646e3ce63
Sending XEP 85 'gone' messages
Sean Egan <seanegan@pidgin.im>
parents:
15598
diff
changeset
|
689 | jabber_message_send(jm); |
|
b58646e3ce63
Sending XEP 85 'gone' messages
Sean Egan <seanegan@pidgin.im>
parents:
15598
diff
changeset
|
690 | jabber_message_free(jm); |
|
b58646e3ce63
Sending XEP 85 'gone' messages
Sean Egan <seanegan@pidgin.im>
parents:
15598
diff
changeset
|
691 | } |