comparison libpurple/protocols/jabber/message.c @ 29278:68f6de7d1408

Make it work again after the merge from i.p.p.... :) Had to duplicate some stuff from prpl.c in jabber.c to output the attention message when sending one using the /buzz command, until I figure out a better way of doing it...
author Marcus Lundblad <ml@update.uu.se>
date Mon, 02 Mar 2009 23:34:48 +0000
parents b98519a42e53
children 5640246d96c1
comparison
equal deleted inserted replaced
29277:b98519a42e53 29278:68f6de7d1408
116 purple_conversation_write(conv, "", buf, 116 purple_conversation_write(conv, "", buf,
117 PURPLE_MESSAGE_SYSTEM, time(NULL)); 117 PURPLE_MESSAGE_SYSTEM, time(NULL));
118 } 118 }
119 } 119 }
120 serv_got_typing_stopped(jm->js->gc, from); 120 serv_got_typing_stopped(jm->js->gc, from);
121 121
122 } else { 122 } else {
123 serv_got_typing_stopped(jm->js->gc, from); 123 serv_got_typing_stopped(jm->js->gc, from);
124 } 124 }
125 } else { 125 } else {
126 if(jbr) { 126 if(jbr) {
136 136
137 if(jbr->thread_id) 137 if(jbr->thread_id)
138 g_free(jbr->thread_id); 138 g_free(jbr->thread_id);
139 jbr->thread_id = g_strdup(jbr->thread_id); 139 jbr->thread_id = g_strdup(jbr->thread_id);
140 } 140 }
141 141
142 if (jm->js->googletalk && jm->xhtml == NULL) { 142 if (jm->js->googletalk && jm->xhtml == NULL) {
143 char *tmp = jm->body; 143 char *tmp = jm->body;
144 jm->body = jabber_google_format_to_html(jm->body); 144 jm->body = jabber_google_format_to_html(jm->body);
145 g_free(tmp); 145 g_free(tmp);
146 } 146 }
287 } 287 }
288 288
289 static void handle_buzz(JabberMessage *jm) { 289 static void handle_buzz(JabberMessage *jm) {
290 PurpleBuddy *buddy; 290 PurpleBuddy *buddy;
291 PurpleAccount *account; 291 PurpleAccount *account;
292 PurpleConversation *c;
293 char *username;
292 294
293 /* Delayed buzz MUST NOT be accepted */ 295 /* Delayed buzz MUST NOT be accepted */
294 if(jm->delayed) 296 if(jm->delayed)
295 return; 297 return;
296 298
301 account = purple_connection_get_account(jm->js->gc); 303 account = purple_connection_get_account(jm->js->gc);
302 304
303 if ((buddy = purple_find_buddy(account, jm->from)) == NULL) 305 if ((buddy = purple_find_buddy(account, jm->from)) == NULL)
304 return; /* Do not accept buzzes from unknown people */ 306 return; /* Do not accept buzzes from unknown people */
305 307
308 c = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, jm->from, account);
309 if (c == NULL)
310 c = purple_conversation_new(PURPLE_CONV_TYPE_IM, account, jm->from);
311
312 username = g_markup_escape_text(purple_buddy_get_alias(buddy), -1);
306 /* xmpp only has 1 attention type, so index is 0 */ 313 /* xmpp only has 1 attention type, so index is 0 */
307 purple_prpl_got_attention(jm->js->gc, jm->from, 0); 314 purple_prpl_got_attention(jm->js->gc, jm->from, 0);
315 purple_conversation_attention(c, jm->from, 0, PURPLE_MESSAGE_RECV, time(NULL));
316
317 g_free(username);
308 } 318 }
309 319
310 /* used internally by the functions below */ 320 /* used internally by the functions below */
311 typedef struct { 321 typedef struct {
312 gchar *cid; 322 gchar *cid;