Mercurial > pidgin
comparison src/protocols/msn/userlist.c @ 10533:ace8cd0de6ea
[gaim-migrate @ 11862]
Some minor MSN reorganization from Felipe and a bunch of MSN chat related fixes
and improvements from me.
committer: Tailor Script <tailor@pidgin.im>
author | Stu Tomlinson <stu@nosnilmot.com> |
---|---|
date | Thu, 20 Jan 2005 16:37:14 +0000 |
parents | 1a97d5e88d12 |
children | fed2a7c2471d |
comparison
equal
deleted
inserted
replaced
10532:8f2b74c5aa24 | 10533:ace8cd0de6ea |
---|---|
151 { | 151 { |
152 const char *store_name; | 152 const char *store_name; |
153 | 153 |
154 g_return_val_if_fail(user != NULL, NULL); | 154 g_return_val_if_fail(user != NULL, NULL); |
155 | 155 |
156 if ((store_name = msn_user_get_store_name(user)) != NULL) | 156 store_name = msn_user_get_store_name(user); |
157 return gaim_url_encode(store_name); | 157 |
158 | 158 if (store_name != NULL) |
159 return msn_user_get_passport(user); | 159 store_name = gaim_url_encode(store_name); |
160 else | |
161 store_name = msn_user_get_passport(user); | |
162 | |
163 /* this might be a bit of a hack, but it should prevent notification server | |
164 * disconnections for people who have buddies with insane friendly names | |
165 * who added you to their buddy list from being disconnected. Stu. */ | |
166 /* Shx: What? Isn't the store_name obtained from the server, and hence it's | |
167 * below the BUDDY_ALIAS_MAXLEN ? */ | |
168 /* Stu: yeah, that's why it's a bit of a hack, as you pointed out, we're | |
169 * probably decoding the incoming store_name wrong, or something. bleh. */ | |
170 | |
171 if (strlen(store_name) > BUDDY_ALIAS_MAXLEN) | |
172 store_name = msn_user_get_passport(user); | |
173 | |
174 return store_name; | |
160 } | 175 } |
161 | 176 |
162 static void | 177 static void |
163 msn_request_add_group(MsnUserList *userlist, const char *who, | 178 msn_request_add_group(MsnUserList *userlist, const char *who, |
164 const char *old_group_name, const char *new_group_name) | 179 const char *old_group_name, const char *new_group_name) |
464 | 479 |
465 void | 480 void |
466 msn_userlist_remove_group(MsnUserList *userlist, MsnGroup *group) | 481 msn_userlist_remove_group(MsnUserList *userlist, MsnGroup *group) |
467 { | 482 { |
468 userlist->groups = g_list_remove(userlist->groups, group); | 483 userlist->groups = g_list_remove(userlist->groups, group); |
469 msn_group_destroy(group); | |
470 } | 484 } |
471 | 485 |
472 MsnGroup * | 486 MsnGroup * |
473 msn_userlist_find_group_with_id(MsnUserList *userlist, int id) | 487 msn_userlist_find_group_with_id(MsnUserList *userlist, int id) |
474 { | 488 { |
551 MsnGroup *group; | 565 MsnGroup *group; |
552 | 566 |
553 group = msn_userlist_find_group_with_id(userlist, group_id); | 567 group = msn_userlist_find_group_with_id(userlist, group_id); |
554 | 568 |
555 if (group != NULL) | 569 if (group != NULL) |
570 { | |
556 msn_userlist_remove_group(userlist, group); | 571 msn_userlist_remove_group(userlist, group); |
572 msn_group_destroy(group); | |
573 } | |
557 } | 574 } |
558 | 575 |
559 void | 576 void |
560 msn_userlist_rem_buddy(MsnUserList *userlist, | 577 msn_userlist_rem_buddy(MsnUserList *userlist, |
561 const char *who, int list_id, const char *group_name) | 578 const char *who, int list_id, const char *group_name) |
628 return; | 645 return; |
629 } | 646 } |
630 | 647 |
631 store_name = (user != NULL) ? get_store_name(user) : who; | 648 store_name = (user != NULL) ? get_store_name(user) : who; |
632 | 649 |
633 /* this might be a bit of a hack, but it should prevent notification server | |
634 * disconnections for people who have buddies with insane friendly names | |
635 * who added you to their buddy list from being disconnected. Stu. */ | |
636 /* ... No, that sentence didn't parse for me either. Stu. */ | |
637 if (strlen(store_name) > BUDDY_ALIAS_MAXLEN) | |
638 store_name = who; | |
639 | |
640 /* Then request the add to the server. */ | 650 /* Then request the add to the server. */ |
641 list = lists[list_id]; | 651 list = lists[list_id]; |
642 | 652 |
643 msn_notification_add_buddy(userlist->session->notification, list, who, | 653 msn_notification_add_buddy(userlist->session->notification, list, who, |
644 store_name, group_id); | 654 store_name, group_id); |