Mercurial > pidgin.yaz
comparison src/protocols/msn/notification.c @ 6858:885c6528843b
[gaim-migrate @ 7403]
Moving MSN buddies between groups should no longer reset their server-side
friendly name.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Tue, 16 Sep 2003 03:56:54 +0000 |
parents | ccfbd7c552ba |
children | 1da447732906 |
comparison
equal
deleted
inserted
replaced
6857:59f6d0b1bdbe | 6858:885c6528843b |
---|---|
101 b = NULL; | 101 b = NULL; |
102 } | 102 } |
103 | 103 |
104 if (b == NULL) | 104 if (b == NULL) |
105 { | 105 { |
106 b = gaim_buddy_new(account, | 106 const char *passport, *friendly; |
107 msn_user_get_passport(user), NULL); | 107 |
108 passport = msn_user_get_passport(user); | |
109 | |
110 b = gaim_buddy_new(account, passport, NULL); | |
108 | 111 |
109 b->proto_data = user; | 112 b->proto_data = user; |
110 | 113 |
111 gaim_blist_add_buddy(b, NULL, g, NULL); | 114 gaim_blist_add_buddy(b, NULL, g, NULL); |
115 | |
116 if ((friendly = msn_user_get_name(user)) != NULL) | |
117 serv_got_alias(gc, passport, friendly); | |
112 } | 118 } |
113 else | 119 else |
114 b->proto_data = user; | 120 b->proto_data = user; |
115 } | 121 } |
116 | 122 |
1050 | 1056 |
1051 state = params[1]; | 1057 state = params[1]; |
1052 passport = params[2]; | 1058 passport = params[2]; |
1053 friend = msn_url_decode(params[3]); | 1059 friend = msn_url_decode(params[3]); |
1054 | 1060 |
1061 user = msn_users_find_with_passport(session->users, passport); | |
1062 | |
1055 serv_got_alias(gc, (char *)passport, (char *)friend); | 1063 serv_got_alias(gc, (char *)passport, (char *)friend); |
1056 | 1064 |
1065 msn_user_set_name(user, friend); | |
1066 | |
1057 if (session->protocol_ver >= 9 && param_count == 6) | 1067 if (session->protocol_ver >= 9 && param_count == 6) |
1058 { | 1068 { |
1059 user = msn_users_find_with_passport(session->users, passport); | |
1060 | |
1061 msnobj = msn_object_new_from_string(msn_url_decode(params[5])); | 1069 msnobj = msn_object_new_from_string(msn_url_decode(params[5])); |
1062 msn_user_set_object(user, msnobj); | 1070 msn_user_set_object(user, msnobj); |
1063 } | 1071 } |
1064 | 1072 |
1065 if ((b = gaim_find_buddy(gc->account, passport)) != NULL) | 1073 if ((b = gaim_find_buddy(gc->account, passport)) != NULL) |
1469 | 1477 |
1470 state = params[0]; | 1478 state = params[0]; |
1471 passport = params[1]; | 1479 passport = params[1]; |
1472 friend = msn_url_decode(params[2]); | 1480 friend = msn_url_decode(params[2]); |
1473 | 1481 |
1482 user = msn_users_find_with_passport(session->users, passport); | |
1483 | |
1474 serv_got_alias(gc, (char *)passport, (char *)friend); | 1484 serv_got_alias(gc, (char *)passport, (char *)friend); |
1475 | 1485 |
1486 msn_user_set_name(user, friend); | |
1487 | |
1476 if (session->protocol_ver >= 9 && param_count == 5) | 1488 if (session->protocol_ver >= 9 && param_count == 5) |
1477 { | 1489 { |
1478 user = msn_users_find_with_passport(session->users, passport); | |
1479 | |
1480 msnobj = msn_object_new_from_string(msn_url_decode(params[4])); | 1490 msnobj = msn_object_new_from_string(msn_url_decode(params[4])); |
1481 msn_user_set_object(user, msnobj); | 1491 msn_user_set_object(user, msnobj); |
1482 } | 1492 } |
1483 | 1493 |
1484 if (!g_ascii_strcasecmp(state, "BSY")) | 1494 if (!g_ascii_strcasecmp(state, "BSY")) |
1595 | 1605 |
1596 /* I hate this. */ | 1606 /* I hate this. */ |
1597 if (session->moving_buddy) { | 1607 if (session->moving_buddy) { |
1598 MsnGroup *group, *old_group; | 1608 MsnGroup *group, *old_group; |
1599 GaimConnection *gc = session->account->gc; | 1609 GaimConnection *gc = session->account->gc; |
1610 const char *friendly; | |
1600 char outparams[MSN_BUF_LEN]; | 1611 char outparams[MSN_BUF_LEN]; |
1601 | 1612 |
1602 group = msn_groups_find_with_name(session->groups, | 1613 group = msn_groups_find_with_name(session->groups, |
1603 session->dest_group_name); | 1614 session->dest_group_name); |
1604 | 1615 |
1619 } | 1630 } |
1620 | 1631 |
1621 g_free(session->dest_group_name); | 1632 g_free(session->dest_group_name); |
1622 session->dest_group_name = NULL; | 1633 session->dest_group_name = NULL; |
1623 | 1634 |
1635 if ((friendly = msn_user_get_name(session->moving_user)) == NULL) | |
1636 friendly = passport; | |
1637 | |
1624 g_snprintf(outparams, sizeof(outparams), "FL %s %s %d", | 1638 g_snprintf(outparams, sizeof(outparams), "FL %s %s %d", |
1625 passport, passport, msn_group_get_id(group)); | 1639 passport, friendly, msn_group_get_id(group)); |
1626 | 1640 |
1627 if (!msn_servconn_send_command(session->notification_conn, | 1641 if (!msn_servconn_send_command(session->notification_conn, |
1628 "ADD", outparams)) { | 1642 "ADD", outparams)) { |
1629 gaim_connection_error(gc, _("Write error")); | 1643 gaim_connection_error(gc, _("Write error")); |
1630 return FALSE; | 1644 return FALSE; |