| 124 |
124 |
| 125 GaimAccount * |
125 GaimAccount * |
| 126 gaim_account_new(const char *username, GaimProtocol protocol) |
126 gaim_account_new(const char *username, GaimProtocol protocol) |
| 127 { |
127 { |
| 128 GaimAccount *account; |
128 GaimAccount *account; |
| |
129 GList *l; |
| 129 |
130 |
| 130 g_return_val_if_fail(username != NULL, NULL); |
131 g_return_val_if_fail(username != NULL, NULL); |
| |
132 |
| |
133 for (l = gaim_accounts_get_all(); l != NULL; l = l->next) { |
| |
134 account = l->data; |
| |
135 |
| |
136 if (!strcmp(gaim_account_get_username(account), username) && |
| |
137 gaim_account_get_protocol(account) == protocol) { |
| |
138 |
| |
139 return account; |
| |
140 } |
| |
141 } |
| 131 |
142 |
| 132 account = g_new0(GaimAccount, 1); |
143 account = g_new0(GaimAccount, 1); |
| 133 |
144 |
| 134 gaim_account_set_username(account, username); |
145 gaim_account_set_username(account, username); |
| 135 gaim_account_set_protocol(account, protocol); |
146 gaim_account_set_protocol(account, protocol); |