src/account.c

changeset 5665
0115e8068f51
parent 5659
b263ee0ceaac
child 5666
4f72b82ba830
equal deleted inserted replaced
5664:4adde60ed7da 5665:0115e8068f51
31 #include <sys/types.h> 31 #include <sys/types.h>
32 #include <glib.h> 32 #include <glib.h>
33 33
34 #include "account.h" 34 #include "account.h"
35 #include "prefs.h" 35 #include "prefs.h"
36 #include "prpl.h"
36 37
37 typedef enum 38 typedef enum
38 { 39 {
39 TAG_NONE = 0, 40 TAG_NONE = 0,
40 TAG_PROTOCOL, 41 TAG_PROTOCOL,
246 } 247 }
247 248
248 void 249 void
249 gaim_account_set_protocol(GaimAccount *account, GaimProtocol protocol) 250 gaim_account_set_protocol(GaimAccount *account, GaimProtocol protocol)
250 { 251 {
251 g_return_if_fail(account != NULL); 252 GaimPlugin *plugin;
253
254 g_return_if_fail(account != NULL);
255
256 plugin = gaim_find_prpl(protocol);
257
258 g_return_if_fail(plugin != NULL);
252 259
253 account->protocol = protocol; 260 account->protocol = protocol;
261
262 if (account->protocol_id != NULL)
263 g_free(account->protocol_id);
264
265 account->protocol_id = g_strdup(plugin->info->id);
254 266
255 schedule_accounts_save(); 267 schedule_accounts_save();
256 } 268 }
257 269
258 void 270 void

mercurial