diff options
Diffstat (limited to 'src/gnunet_chat_handle_intern.c')
-rw-r--r-- | src/gnunet_chat_handle_intern.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/gnunet_chat_handle_intern.c b/src/gnunet_chat_handle_intern.c index e3f660d..f4ec2e9 100644 --- a/src/gnunet_chat_handle_intern.c +++ b/src/gnunet_chat_handle_intern.c | |||
@@ -207,10 +207,7 @@ on_handle_gnunet_identity(void *cls, | |||
207 | struct GNUNET_CHAT_Handle* handle = cls; | 207 | struct GNUNET_CHAT_Handle* handle = cls; |
208 | 208 | ||
209 | if ((!name) || (!ego)) | 209 | if ((!name) || (!ego)) |
210 | { | 210 | goto send_refresh; |
211 | handle_send_internal_message(handle, NULL, GNUNET_CHAT_FLAG_REFRESH, NULL); | ||
212 | return; | ||
213 | } | ||
214 | 211 | ||
215 | struct GNUNET_CHAT_InternalAccounts *accounts = handle->accounts_head; | 212 | struct GNUNET_CHAT_InternalAccounts *accounts = handle->accounts_head; |
216 | 213 | ||
@@ -223,13 +220,13 @@ on_handle_gnunet_identity(void *cls, | |||
223 | (0 == strcmp(accounts->account->name, name))) | 220 | (0 == strcmp(accounts->account->name, name))) |
224 | { | 221 | { |
225 | accounts->account->ego = ego; | 222 | accounts->account->ego = ego; |
226 | return; | 223 | goto send_refresh; |
227 | } | 224 | } |
228 | 225 | ||
229 | if (ego == accounts->account->ego) | 226 | if (ego == accounts->account->ego) |
230 | { | 227 | { |
231 | util_set_name_field(name, &(accounts->account->name)); | 228 | util_set_name_field(name, &(accounts->account->name)); |
232 | return; | 229 | goto send_refresh; |
233 | } | 230 | } |
234 | 231 | ||
235 | skip_account: | 232 | skip_account: |
@@ -239,11 +236,17 @@ skip_account: | |||
239 | accounts = GNUNET_new(struct GNUNET_CHAT_InternalAccounts); | 236 | accounts = GNUNET_new(struct GNUNET_CHAT_InternalAccounts); |
240 | accounts->account = account_create_from_ego(ego, name); | 237 | accounts->account = account_create_from_ego(ego, name); |
241 | 238 | ||
239 | if (handle->directory) | ||
240 | account_update_directory(accounts->account, handle->directory); | ||
241 | |||
242 | GNUNET_CONTAINER_DLL_insert_tail( | 242 | GNUNET_CONTAINER_DLL_insert_tail( |
243 | handle->accounts_head, | 243 | handle->accounts_head, |
244 | handle->accounts_tail, | 244 | handle->accounts_tail, |
245 | accounts | 245 | accounts |
246 | ); | 246 | ); |
247 | |||
248 | send_refresh: | ||
249 | handle_send_internal_message(handle, NULL, GNUNET_CHAT_FLAG_REFRESH, NULL); | ||
247 | } | 250 | } |
248 | 251 | ||
249 | int | 252 | int |