Mercurial > pidgin.yaz
comparison src/protocols/jabber/message.c @ 7306:7c12dab8e513
[gaim-migrate @ 7890]
this should implement the full nodeprep, nameprep, and resourceprep string
profiles, so we compare JIDs correctly
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Mon, 20 Oct 2003 20:41:42 +0000 |
parents | 1930e3d00ecd |
children | dd4b4a187171 |
comparison
equal
deleted
inserted
replaced
7305:fa25f82dda21 | 7306:7c12dab8e513 |
---|---|
77 | 77 |
78 JabberBuddy *jb; | 78 JabberBuddy *jb; |
79 JabberBuddyResource *jbr; | 79 JabberBuddyResource *jbr; |
80 | 80 |
81 jb = jabber_buddy_find(jm->js, jm->from, TRUE); | 81 jb = jabber_buddy_find(jm->js, jm->from, TRUE); |
82 jbr = jabber_buddy_find_resource(jb, jabber_get_resource(jm->from)); | 82 jbr = jabber_buddy_find_resource(jb, jid->resource); |
83 | 83 |
84 if(find_unnormalized_conv(jm->from, jm->js->gc->account)) { | 84 if(find_unnormalized_conv(jm->from, jm->js->gc->account)) { |
85 from = g_strdup(jm->from); | 85 from = g_strdup(jm->from); |
86 } else if(jid->node) { | 86 } else if(jid->node) { |
87 GaimConversation *conv; | 87 GaimConversation *conv; |
172 if(jm->subject) | 172 if(jm->subject) |
173 gaim_conv_chat_set_topic(GAIM_CONV_CHAT(chat->conv), jid->resource, | 173 gaim_conv_chat_set_topic(GAIM_CONV_CHAT(chat->conv), jid->resource, |
174 jm->subject); | 174 jm->subject); |
175 | 175 |
176 if(jm->xhtml || jm->body) | 176 if(jm->xhtml || jm->body) |
177 serv_got_chat_in(jm->js->gc, chat->id, jabber_get_resource(jm->from), | 177 serv_got_chat_in(jm->js->gc, chat->id, jid->resource, |
178 0, jm->xhtml ? jm->xhtml : jm->body, jm->sent); | 178 0, jm->xhtml ? jm->xhtml : jm->body, jm->sent); |
179 jabber_id_free(jid); | 179 jabber_id_free(jid); |
180 } | 180 } |
181 | 181 |
182 static void handle_groupchat_invite(JabberMessage *jm) | 182 static void handle_groupchat_invite(JabberMessage *jm) |
410 JabberMessage *jm; | 410 JabberMessage *jm; |
411 JabberBuddy *jb; | 411 JabberBuddy *jb; |
412 JabberBuddyResource *jbr; | 412 JabberBuddyResource *jbr; |
413 char *buf; | 413 char *buf; |
414 char *xhtml; | 414 char *xhtml; |
415 char *resource; | |
415 | 416 |
416 if(!who || !msg) | 417 if(!who || !msg) |
417 return 0; | 418 return 0; |
418 | 419 |
420 resource = jabber_get_resource(who); | |
421 | |
419 jb = jabber_buddy_find(gc->proto_data, who, TRUE); | 422 jb = jabber_buddy_find(gc->proto_data, who, TRUE); |
420 jbr = jabber_buddy_find_resource(jb, jabber_get_resource(who)); | 423 jbr = jabber_buddy_find_resource(jb, resource); |
424 | |
425 g_free(resource); | |
421 | 426 |
422 jm = g_new0(JabberMessage, 1); | 427 jm = g_new0(JabberMessage, 1); |
423 jm->js = gc->proto_data; | 428 jm->js = gc->proto_data; |
424 jm->type = JABBER_MESSAGE_CHAT; | 429 jm->type = JABBER_MESSAGE_CHAT; |
425 jm->events = JABBER_MESSAGE_EVENT_COMPOSING; | 430 jm->events = JABBER_MESSAGE_EVENT_COMPOSING; |
466 int jabber_send_typing(GaimConnection *gc, const char *who, int typing) | 471 int jabber_send_typing(GaimConnection *gc, const char *who, int typing) |
467 { | 472 { |
468 JabberMessage *jm; | 473 JabberMessage *jm; |
469 JabberBuddy *jb; | 474 JabberBuddy *jb; |
470 JabberBuddyResource *jbr; | 475 JabberBuddyResource *jbr; |
476 char *resource = jabber_get_resource(who); | |
471 | 477 |
472 jb = jabber_buddy_find(gc->proto_data, who, TRUE); | 478 jb = jabber_buddy_find(gc->proto_data, who, TRUE); |
473 jbr = jabber_buddy_find_resource(jb, jabber_get_resource(who)); | 479 jbr = jabber_buddy_find_resource(jb, resource); |
480 | |
481 g_free(resource); | |
474 | 482 |
475 if(!jbr || !(jbr->capabilities & JABBER_CAP_COMPOSING)) | 483 if(!jbr || !(jbr->capabilities & JABBER_CAP_COMPOSING)) |
476 return 0; | 484 return 0; |
477 | 485 |
478 jm = g_new0(JabberMessage, 1); | 486 jm = g_new0(JabberMessage, 1); |