comparison libgaim/protocols/msn/dialog.c @ 20390:d634f88e25d8

msn.tgz from SF Patch #1621854 from Ka-Hing Cheung "This tarball brings soc-2006-msnp13 up to head. In addition to that it also fixes a crash with sending offline messages. I wasn't able to generate a diff against that branch, svn seems to insist on diff'ing against HEAD after I run the merge command. After running `svn merge -r 16309:HEAD https://gaim.svn.sourceforge.net/svnroot/gaim/trunk` on the soc-2006-msnp13 you can replace the msn directory with the attached tarball. The fix for offline messaging is on msn.c:901: if (!session->oim) session->oim = msn_oim_new(session)" committer: Richard Laager <rlaager@wiktel.com>
author Ka-Hing Cheung <khc@hxbc.us>
date Sun, 15 Apr 2007 02:18:17 +0000
parents e354528c4163
children 9755b2f7bb0f
comparison
equal deleted inserted replaced
20389:e354528c4163 20390:d634f88e25d8
32 char *group; 32 char *group;
33 gboolean add; 33 gboolean add;
34 34
35 } MsnAddRemData; 35 } MsnAddRemData;
36 36
37 /* Remove the buddy referenced by the MsnAddRemData before the serverside list is changed.
38 * If the buddy will be added, he'll be added back; if he will be removed, he won't be. */
39 static void
40 msn_complete_sync_issue(MsnAddRemData *data)
41 {
42 GaimBuddy *buddy;
43 GaimGroup *group = NULL;
44
45 if (data->group != NULL)
46 group = gaim_find_group(data->group);
47
48 if (group != NULL)
49 buddy = gaim_find_buddy_in_group(gaim_connection_get_account(data->gc), data->who, group);
50 else
51 buddy = gaim_find_buddy(gaim_connection_get_account(data->gc), data->who);
52
53 if (buddy != NULL)
54 gaim_blist_remove_buddy(buddy);
55 }
56
57 static void 37 static void
58 msn_add_cb(MsnAddRemData *data) 38 msn_add_cb(MsnAddRemData *data)
59 { 39 {
60 MsnSession *session; 40 if (g_list_find(gaim_connections_get_all(), data->gc) != NULL)
61 MsnUserList *userlist; 41 {
42 MsnSession *session = data->gc->proto_data;
43 MsnUserList *userlist = session->userlist;
62 44
63 msn_complete_sync_issue(data); 45 msn_userlist_add_buddy(userlist, data->who, MSN_LIST_FL, data->group);
46 }
64 47
65 session = data->gc->proto_data; 48 if (data->group != NULL)
66 userlist = session->userlist; 49 g_free(data->group);
67 50
68 msn_userlist_add_buddy(userlist, data->who, MSN_LIST_FL, data->group);
69
70 g_free(data->group);
71 g_free(data->who); 51 g_free(data->who);
72 g_free(data); 52 g_free(data);
73 } 53 }
74 54
75 static void 55 static void
76 msn_rem_cb(MsnAddRemData *data) 56 msn_rem_cb(MsnAddRemData *data)
77 { 57 {
78 MsnSession *session; 58 if (g_list_find(gaim_connections_get_all(), data->gc) != NULL)
79 MsnUserList *userlist; 59 {
60 MsnSession *session = data->gc->proto_data;
61 MsnUserList *userlist = session->userlist;
80 62
81 msn_complete_sync_issue(data); 63 msn_userlist_rem_buddy(userlist, data->who, MSN_LIST_FL, data->group);
64 }
82 65
83 session = data->gc->proto_data; 66 if (data->group != NULL)
84 userlist = session->userlist; 67 g_free(data->group);
85 68
86 msn_userlist_rem_buddy(userlist, data->who, MSN_LIST_FL, data->group);
87
88 g_free(data->group);
89 g_free(data->who); 69 g_free(data->who);
90 g_free(data); 70 g_free(data);
91 } 71 }
92 72
93 void 73 void
111 91
112 msg = g_strdup_printf(_("Buddy list synchronization issue in %s (%s)"), 92 msg = g_strdup_printf(_("Buddy list synchronization issue in %s (%s)"),
113 gaim_account_get_username(account), 93 gaim_account_get_username(account),
114 gaim_account_get_protocol_name(account)); 94 gaim_account_get_protocol_name(account));
115 95
116 if (group_name != NULL) 96 if (group_name != NULL){
117 {
118 reason = g_strdup_printf(_("%s on the local list is " 97 reason = g_strdup_printf(_("%s on the local list is "
119 "inside the group \"%s\" but not on " 98 "inside the group \"%s\" but not on "
120 "the server list. " 99 "the server list. "
121 "Do you want this buddy to be added?"), 100 "Do you want this buddy to be added?"),
122 passport, group_name); 101 passport, group_name);
123 } 102 }else{
124 else
125 {
126 reason = g_strdup_printf(_("%s is on the local list but " 103 reason = g_strdup_printf(_("%s is on the local list but "
127 "not on the server list. " 104 "not on the server list. "
128 "Do you want this buddy to be added?"), 105 "Do you want this buddy to be added?"),
129 passport); 106 passport);
130 } 107 }
135 _("No"), G_CALLBACK(msn_rem_cb)); 112 _("No"), G_CALLBACK(msn_rem_cb));
136 113
137 if (group_name != NULL) 114 if (group_name != NULL)
138 group = gaim_find_group(group_name); 115 group = gaim_find_group(group_name);
139 116
140 if (group != NULL) 117 if (group != NULL){
141 buddy = gaim_find_buddy_in_group(account, passport, group); 118 buddy = gaim_find_buddy_in_group(account, passport, group);
142 else 119 }else{
143 buddy = gaim_find_buddy(account, passport); 120 buddy = gaim_find_buddy(account, passport);
121 }
144 122
145 if (buddy != NULL) 123 if (buddy != NULL)
146 gaim_blist_remove_buddy(buddy); 124 gaim_blist_remove_buddy(buddy);
147 125
148 g_free(reason); 126 g_free(reason);