diff options
Diffstat (limited to 'src/gnunet_chat_lib.c')
-rw-r--r-- | src/gnunet_chat_lib.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/gnunet_chat_lib.c b/src/gnunet_chat_lib.c index 25e670d..8ec7499 100644 --- a/src/gnunet_chat_lib.c +++ b/src/gnunet_chat_lib.c | |||
@@ -553,7 +553,9 @@ GNUNET_CHAT_contact_delete (struct GNUNET_CHAT_Contact *contact) | |||
553 | ); | 553 | ); |
554 | 554 | ||
555 | GNUNET_MESSENGER_close_room(contact->context->room); | 555 | GNUNET_MESSENGER_close_room(contact->context->room); |
556 | context_delete_records(contact->context); | 556 | |
557 | contact->context->deleted = GNUNET_YES; | ||
558 | context_write_records(contact->context); | ||
557 | 559 | ||
558 | context_destroy(contact->context); | 560 | context_destroy(contact->context); |
559 | contact_destroy(contact); | 561 | contact_destroy(contact); |
@@ -581,7 +583,7 @@ GNUNET_CHAT_contact_get_name (const struct GNUNET_CHAT_Contact *contact) | |||
581 | if (!contact) | 583 | if (!contact) |
582 | return NULL; | 584 | return NULL; |
583 | 585 | ||
584 | if ((contact->context) && (contact->context->nick)) | 586 | if ((contact->context) && (contact->context->nick[0])) |
585 | return contact->context->nick; | 587 | return contact->context->nick; |
586 | 588 | ||
587 | return GNUNET_MESSENGER_contact_get_name(contact->member); | 589 | return GNUNET_MESSENGER_contact_get_name(contact->member); |
@@ -671,7 +673,9 @@ GNUNET_CHAT_group_leave (struct GNUNET_CHAT_Group *group) | |||
671 | ); | 673 | ); |
672 | 674 | ||
673 | GNUNET_MESSENGER_close_room(group->context->room); | 675 | GNUNET_MESSENGER_close_room(group->context->room); |
674 | context_delete_records(group->context); | 676 | |
677 | group->context->deleted = GNUNET_YES; | ||
678 | context_write_records(group->context); | ||
675 | 679 | ||
676 | context_destroy(group->context); | 680 | context_destroy(group->context); |
677 | group_destroy(group); | 681 | group_destroy(group); |
@@ -687,7 +691,9 @@ GNUNET_CHAT_group_set_name (struct GNUNET_CHAT_Group *group, | |||
687 | return; | 691 | return; |
688 | 692 | ||
689 | context_update_nick(group->context, name); | 693 | context_update_nick(group->context, name); |
690 | context_write_records(group->context); | 694 | |
695 | if (group->context->room) | ||
696 | context_write_records(group->context); | ||
691 | } | 697 | } |
692 | 698 | ||
693 | 699 | ||
@@ -697,7 +703,7 @@ GNUNET_CHAT_group_get_name (const struct GNUNET_CHAT_Group *group) | |||
697 | if ((!group) || (!(group->context))) | 703 | if ((!group) || (!(group->context))) |
698 | return NULL; | 704 | return NULL; |
699 | 705 | ||
700 | if (group->context->nick) | 706 | if (group->context->nick[0]) |
701 | return group->context->nick; | 707 | return group->context->nick; |
702 | 708 | ||
703 | return group->context->topic; | 709 | return group->context->topic; |