aboutsummaryrefslogtreecommitdiff
path: root/src/gnunet_chat_lib_intern.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gnunet_chat_lib_intern.c')
-rw-r--r--src/gnunet_chat_lib_intern.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/gnunet_chat_lib_intern.c b/src/gnunet_chat_lib_intern.c
index a770367..0ef2b72 100644
--- a/src/gnunet_chat_lib_intern.c
+++ b/src/gnunet_chat_lib_intern.c
@@ -95,6 +95,7 @@ it_handle_iterate_groups (void *cls,
95 95
96struct GNUNET_CHAT_RoomFindContact 96struct GNUNET_CHAT_RoomFindContact
97{ 97{
98 const struct GNUNET_IDENTITY_PublicKey *ignore_key;
98 const struct GNUNET_MESSENGER_Contact *contact; 99 const struct GNUNET_MESSENGER_Contact *contact;
99}; 100};
100 101
@@ -105,7 +106,16 @@ it_room_find_contact (void *cls,
105{ 106{
106 GNUNET_assert((cls) && (member)); 107 GNUNET_assert((cls) && (member));
107 108
109 const struct GNUNET_IDENTITY_PublicKey *key = GNUNET_MESSENGER_contact_get_key(
110 member
111 );
112
108 struct GNUNET_CHAT_RoomFindContact *find = cls; 113 struct GNUNET_CHAT_RoomFindContact *find = cls;
114
115 if ((find->ignore_key) && (key) &&
116 (0 == GNUNET_memcmp(find->ignore_key, key)))
117 return GNUNET_YES;
118
109 find->contact = member; 119 find->contact = member;
110 return GNUNET_NO; 120 return GNUNET_NO;
111} 121}
@@ -129,14 +139,9 @@ it_group_iterate_contacts (void* cls,
129 if (!(it->cb)) 139 if (!(it->cb))
130 return GNUNET_YES; 140 return GNUNET_YES;
131 141
132 struct GNUNET_ShortHashCode shorthash; 142 return it->cb(it->cls, it->group, handle_get_contact_from_messenger(
133 util_shorthash_from_member(member, &shorthash); 143 it->group->handle, member
134 144 ));
135 struct GNUNET_CHAT_Contact *contact = GNUNET_CONTAINER_multishortmap_get(
136 it->group->handle->contacts, &shorthash
137 );
138
139 return it->cb(it->cls, it->group, contact);
140} 145}
141 146
142struct GNUNET_CHAT_ContextIterateMessages 147struct GNUNET_CHAT_ContextIterateMessages