Mercurial > pidgin
comparison libpurple/protocols/msn/dialog.c @ 20481:eb93710aec4d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
author | Carlos Silva <typ0@pidgin.im> |
---|---|
date | Tue, 28 Aug 2007 03:54:18 +0000 |
parents | bee467c81570 |
children | 723b5a2f91ce |
comparison
equal
deleted
inserted
replaced
20480:7d3e53e3f623 | 20481:eb93710aec4d |
---|---|
67 if (g_list_find(purple_connections_get_all(), data->gc) != NULL) | 67 if (g_list_find(purple_connections_get_all(), data->gc) != NULL) |
68 { | 68 { |
69 MsnSession *session = data->gc->proto_data; | 69 MsnSession *session = data->gc->proto_data; |
70 MsnUserList *userlist = session->userlist; | 70 MsnUserList *userlist = session->userlist; |
71 | 71 |
72 msn_userlist_add_buddy(userlist, data->who, MSN_LIST_FL, data->group); | 72 msn_userlist_add_buddy(userlist, data->who, data->group); |
73 } | 73 } |
74 | 74 |
75 g_free(data->group); | 75 g_free(data->group); |
76 g_free(data->who); | 76 g_free(data->who); |
77 g_free(data); | 77 g_free(data); |
85 if (g_list_find(purple_connections_get_all(), data->gc) != NULL) | 85 if (g_list_find(purple_connections_get_all(), data->gc) != NULL) |
86 { | 86 { |
87 MsnSession *session = data->gc->proto_data; | 87 MsnSession *session = data->gc->proto_data; |
88 MsnUserList *userlist = session->userlist; | 88 MsnUserList *userlist = session->userlist; |
89 | 89 |
90 msn_userlist_rem_buddy(userlist, data->who, MSN_LIST_FL, data->group); | 90 if (data->group == NULL) { |
91 msn_userlist_rem_buddy_from_list(userlist, data->who, MSN_LIST_FL); | |
92 } else { | |
93 g_free(data->group); | |
94 } | |
91 } | 95 } |
92 | 96 |
93 g_free(data->group); | |
94 g_free(data->who); | 97 g_free(data->who); |
95 g_free(data); | 98 g_free(data); |
96 } | 99 } |
97 | 100 |
98 void | 101 void |
107 account = session->account; | 110 account = session->account; |
108 gc = purple_account_get_connection(account); | 111 gc = purple_account_get_connection(account); |
109 | 112 |
110 data = g_new0(MsnAddRemData, 1); | 113 data = g_new0(MsnAddRemData, 1); |
111 data->who = g_strdup(passport); | 114 data->who = g_strdup(passport); |
112 data->group = g_strdup(group_name); | 115 data->group = group_name != NULL ? g_strdup(group_name) : NULL; |
113 data->gc = gc; | 116 data->gc = gc; |
114 | 117 |
115 msg = g_strdup_printf(_("Buddy list synchronization issue in %s (%s)"), | 118 msg = g_strdup_printf(_("Buddy list synchronization issue in %s (%s)"), |
116 purple_account_get_username(account), | 119 purple_account_get_username(account), |
117 purple_account_get_protocol_name(account)); | 120 purple_account_get_protocol_name(account)); |