Mercurial > pidgin.yaz
comparison src/protocols/jabber/buddy.c @ 7955:119a22025818
[gaim-migrate @ 8630]
fun jabber stuff, which isn't done yet. mostly harmless, and committing this now makes the next
commit that much easier for a lazy person such as myself to type.
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Mon, 29 Dec 2003 08:59:22 +0000 |
parents | 72727edb37ef |
children | 8f4ce853e685 |
comparison
equal
deleted
inserted
replaced
7954:6dc91824d8d4 | 7955:119a22025818 |
---|---|
528 const char *from = xmlnode_get_attrib(packet, "from"); | 528 const char *from = xmlnode_get_attrib(packet, "from"); |
529 JabberBuddy *jb; | 529 JabberBuddy *jb; |
530 JabberBuddyResource *jbr; | 530 JabberBuddyResource *jbr; |
531 GString *info_text; | 531 GString *info_text; |
532 char *resource_name; | 532 char *resource_name; |
533 char *bare_jid; | |
533 char *title; | 534 char *title; |
534 xmlnode *vcard; | 535 xmlnode *vcard; |
536 GaimBuddy *b; | |
535 | 537 |
536 if(!from) | 538 if(!from) |
537 return; | 539 return; |
538 | 540 |
539 /* XXX: make this handle handle errors */ | 541 /* XXX: make this handle handle errors */ |
540 | 542 |
541 resource_name = jabber_get_resource(from); | 543 resource_name = jabber_get_resource(from); |
544 bare_jid = jabber_get_bare_jid(from); | |
545 | |
546 b = gaim_find_buddy(js->gc->account, bare_jid); | |
542 | 547 |
543 jb = jabber_buddy_find(js, from, TRUE); | 548 jb = jabber_buddy_find(js, from, TRUE); |
544 info_text = g_string_new(""); | 549 info_text = g_string_new(""); |
545 | 550 |
546 g_string_append_printf(info_text, "<b>%s:</b> %s<br/>\n", _("Jabber ID"), | 551 g_string_append_printf(info_text, "<b>%s:</b> %s<br/>\n", _("Jabber ID"), |
578 g_free(purdy); | 583 g_free(purdy); |
579 } | 584 } |
580 } | 585 } |
581 | 586 |
582 g_free(resource_name); | 587 g_free(resource_name); |
588 g_free(bare_jid); | |
583 | 589 |
584 if((vcard = xmlnode_get_child(packet, "vCard"))) { | 590 if((vcard = xmlnode_get_child(packet, "vCard"))) { |
585 xmlnode *child; | 591 xmlnode *child; |
586 for(child = vcard->child; child; child = child->next) | 592 for(child = vcard->child; child; child = child->next) |
587 { | 593 { |
619 } | 625 } |
620 g_free(text2); | 626 g_free(text2); |
621 } | 627 } |
622 } else if(text && !strcmp(child->name, "NICKNAME")) { | 628 } else if(text && !strcmp(child->name, "NICKNAME")) { |
623 serv_got_alias(js->gc, from, text); | 629 serv_got_alias(js->gc, from, text); |
630 if(b) { | |
631 gaim_blist_node_set_string((GaimBlistNode*)b, "servernick", text); | |
632 gaim_blist_save(); | |
633 } | |
624 g_string_append_printf(info_text, "<b>%s:</b> %s<br/>\n", | 634 g_string_append_printf(info_text, "<b>%s:</b> %s<br/>\n", |
625 _("Nickname"), text); | 635 _("Nickname"), text); |
626 } else if(text && !strcmp(child->name, "BDAY")) { | 636 } else if(text && !strcmp(child->name, "BDAY")) { |
627 g_string_append_printf(info_text, "<b>%s:</b> %s<br/>\n", | 637 g_string_append_printf(info_text, "<b>%s:</b> %s<br/>\n", |
628 _("Birthday"), text); | 638 _("Birthday"), text); |