diff options
Diffstat (limited to 'src/event.c')
-rw-r--r-- | src/event.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/event.c b/src/event.c index 59c47d6..80deb25 100644 --- a/src/event.c +++ b/src/event.c | |||
@@ -412,9 +412,18 @@ event_presence_contact(MESSENGER_Application *app, | |||
412 | msg | 412 | msg |
413 | ); | 413 | ); |
414 | 414 | ||
415 | UI_MESSAGE_Handle *message = (UI_MESSAGE_Handle*) ( | 415 | struct GNUNET_CHAT_Group *group = GNUNET_CHAT_context_get_group(context); |
416 | GNUNET_CHAT_member_get_user_pointer(context, contact) | 416 | |
417 | ); | 417 | UI_MESSAGE_Handle *message = NULL; |
418 | |||
419 | contact_create_info(contact); | ||
420 | |||
421 | if (group) | ||
422 | message = (UI_MESSAGE_Handle*) ( | ||
423 | GNUNET_CHAT_member_get_user_pointer(group, contact) | ||
424 | ); | ||
425 | else | ||
426 | message = (UI_MESSAGE_Handle*) contact_get_last_message_from_info(contact); | ||
418 | 427 | ||
419 | if (message) | 428 | if (message) |
420 | ui_chat_remove_message(handle->chat, app, message); | 429 | ui_chat_remove_message(handle->chat, app, message); |
@@ -422,7 +431,6 @@ event_presence_contact(MESSENGER_Application *app, | |||
422 | message = ui_message_new(app, UI_MESSAGE_STATUS); | 431 | message = ui_message_new(app, UI_MESSAGE_STATUS); |
423 | ui_message_update(message, app, msg); | 432 | ui_message_update(message, app, msg); |
424 | 433 | ||
425 | contact_create_info(contact); | ||
426 | _update_contact_context(contact); | 434 | _update_contact_context(contact); |
427 | 435 | ||
428 | contact_add_name_avatar_to_info(contact, message->sender_avatar); | 436 | contact_add_name_avatar_to_info(contact, message->sender_avatar); |
@@ -453,7 +461,10 @@ event_presence_contact(MESSENGER_Application *app, | |||
453 | 461 | ||
454 | ui_chat_add_message(handle->chat, app, message); | 462 | ui_chat_add_message(handle->chat, app, message); |
455 | 463 | ||
456 | GNUNET_CHAT_member_set_user_pointer(context, contact, message); | 464 | if (group) |
465 | GNUNET_CHAT_member_set_user_pointer(group, contact, message); | ||
466 | else | ||
467 | contact_set_last_message_to_info(contact, message); | ||
457 | 468 | ||
458 | enqueue_chat_entry_update(handle); | 469 | enqueue_chat_entry_update(handle); |
459 | } | 470 | } |