Mercurial > pidgin
comparison libpurple/connection.c @ 18920:2a9d60d7af82
Implemented a callback for unregistering, mirroring the registration callback. Since this is a new API, I can do it properly by passing it right in the unregister function call, instead of having a separate function for setting it.
author | Andreas Monitzer <pidgin@monitzer.com> |
---|---|
date | Tue, 31 Jul 2007 03:50:41 +0000 |
parents | 033b128f7c21 |
children | 301f1597d41f |
comparison
equal
deleted
inserted
replaced
18919:177552010f1d | 18920:2a9d60d7af82 |
---|---|
156 prpl_info->login(account); | 156 prpl_info->login(account); |
157 } | 157 } |
158 } | 158 } |
159 | 159 |
160 void | 160 void |
161 purple_connection_new_unregister(PurpleAccount *account, const char *password) | 161 purple_connection_new_unregister(PurpleAccount *account, const char *password, PurpleAccountUnregistrationCb cb, void *user_data) |
162 { | 162 { |
163 /* Lots of copy/pasted code to avoid API changes. You might want to integrate that into the previous function when posssible. */ | 163 /* Lots of copy/pasted code to avoid API changes. You might want to integrate that into the previous function when posssible. */ |
164 PurpleConnection *gc; | 164 PurpleConnection *gc; |
165 PurplePlugin *prpl; | 165 PurplePlugin *prpl; |
166 PurplePluginProtocolInfo *prpl_info; | 166 PurplePluginProtocolInfo *prpl_info; |
180 g_free(message); | 180 g_free(message); |
181 return; | 181 return; |
182 } | 182 } |
183 | 183 |
184 if (!purple_account_is_disconnected(account)) { | 184 if (!purple_account_is_disconnected(account)) { |
185 prpl_info->unregister_user(account); | 185 prpl_info->unregister_user(account, cb, user_data); |
186 return; | 186 return; |
187 } | 187 } |
188 | 188 |
189 if (((password == NULL) || (*password == '\0')) && | 189 if (((password == NULL) || (*password == '\0')) && |
190 !(prpl_info->options & OPT_PROTO_NO_PASSWORD) && | 190 !(prpl_info->options & OPT_PROTO_NO_PASSWORD) && |
208 | 208 |
209 purple_signal_emit(purple_connections_get_handle(), "signing-on", gc); | 209 purple_signal_emit(purple_connections_get_handle(), "signing-on", gc); |
210 | 210 |
211 purple_debug_info("connection", "Unregistering. gc = %p\n", gc); | 211 purple_debug_info("connection", "Unregistering. gc = %p\n", gc); |
212 | 212 |
213 prpl_info->unregister_user(account); | 213 prpl_info->unregister_user(account, cb, user_data); |
214 } | 214 } |
215 | 215 |
216 void | 216 void |
217 purple_connection_destroy(PurpleConnection *gc) | 217 purple_connection_destroy(PurpleConnection *gc) |
218 { | 218 { |