diff options
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/contacts.c | 23 | ||||
-rw-r--r-- | src/ui/new_group.c | 23 |
2 files changed, 6 insertions, 40 deletions
diff --git a/src/ui/contacts.c b/src/ui/contacts.c index 2e445ba..f19c93f 100644 --- a/src/ui/contacts.c +++ b/src/ui/contacts.c | |||
@@ -90,24 +90,15 @@ handle_dialog_destroy(UNUSED GtkWidget *window, | |||
90 | } | 90 | } |
91 | 91 | ||
92 | static int | 92 | static int |
93 | _iterate_clear_contacts(UNUSED void *cls, | ||
94 | UNUSED struct GNUNET_CHAT_Handle *handle, | ||
95 | struct GNUNET_CHAT_Contact *contact) | ||
96 | { | ||
97 | GNUNET_CHAT_contact_set_user_pointer(contact, NULL); | ||
98 | return GNUNET_YES; | ||
99 | } | ||
100 | |||
101 | static int | ||
102 | _iterate_contacts(void *cls, | 93 | _iterate_contacts(void *cls, |
103 | UNUSED struct GNUNET_CHAT_Handle *handle, | 94 | UNUSED struct GNUNET_CHAT_Handle *handle, |
104 | struct GNUNET_CHAT_Contact *contact) | 95 | struct GNUNET_CHAT_Contact *contact) |
105 | { | 96 | { |
106 | MESSENGER_Application *app = (MESSENGER_Application*) cls; | 97 | if (GNUNET_YES == GNUNET_CHAT_contact_is_owned(contact)) |
107 | |||
108 | if (GNUNET_CHAT_contact_get_user_pointer(contact)) | ||
109 | return GNUNET_YES; | 98 | return GNUNET_YES; |
110 | 99 | ||
100 | MESSENGER_Application *app = (MESSENGER_Application*) cls; | ||
101 | |||
111 | const char *title; | 102 | const char *title; |
112 | title = GNUNET_CHAT_contact_get_name(contact); | 103 | title = GNUNET_CHAT_contact_get_name(contact); |
113 | 104 | ||
@@ -119,8 +110,6 @@ _iterate_contacts(void *cls, | |||
119 | entry->entry_box | 110 | entry->entry_box |
120 | ); | 111 | ); |
121 | 112 | ||
122 | GNUNET_CHAT_contact_set_user_pointer(contact, entry); | ||
123 | |||
124 | if (title) | 113 | if (title) |
125 | { | 114 | { |
126 | gtk_label_set_text(entry->title_label, title); | 115 | gtk_label_set_text(entry->title_label, title); |
@@ -201,12 +190,6 @@ ui_contacts_dialog_init(MESSENGER_Application *app, | |||
201 | 190 | ||
202 | GNUNET_CHAT_iterate_contacts( | 191 | GNUNET_CHAT_iterate_contacts( |
203 | app->chat.messenger.handle, | 192 | app->chat.messenger.handle, |
204 | _iterate_clear_contacts, | ||
205 | NULL | ||
206 | ); | ||
207 | |||
208 | GNUNET_CHAT_iterate_contacts( | ||
209 | app->chat.messenger.handle, | ||
210 | _iterate_contacts, | 193 | _iterate_contacts, |
211 | app | 194 | app |
212 | ); | 195 | ); |
diff --git a/src/ui/new_group.c b/src/ui/new_group.c index 6355fcd..3741768 100644 --- a/src/ui/new_group.c +++ b/src/ui/new_group.c | |||
@@ -149,24 +149,15 @@ handle_dialog_destroy(UNUSED GtkWidget *window, | |||
149 | } | 149 | } |
150 | 150 | ||
151 | static int | 151 | static int |
152 | _iterate_clear_contacts(UNUSED void *cls, | ||
153 | UNUSED struct GNUNET_CHAT_Handle *handle, | ||
154 | struct GNUNET_CHAT_Contact *contact) | ||
155 | { | ||
156 | GNUNET_CHAT_contact_set_user_pointer(contact, NULL); | ||
157 | return GNUNET_YES; | ||
158 | } | ||
159 | |||
160 | static int | ||
161 | _iterate_contacts(void *cls, | 152 | _iterate_contacts(void *cls, |
162 | UNUSED struct GNUNET_CHAT_Handle *handle, | 153 | UNUSED struct GNUNET_CHAT_Handle *handle, |
163 | struct GNUNET_CHAT_Contact *contact) | 154 | struct GNUNET_CHAT_Contact *contact) |
164 | { | 155 | { |
165 | MESSENGER_Application *app = (MESSENGER_Application*) cls; | 156 | if (GNUNET_YES == GNUNET_CHAT_contact_is_owned(contact)) |
166 | |||
167 | if (GNUNET_CHAT_contact_get_user_pointer(contact)) | ||
168 | return GNUNET_YES; | 157 | return GNUNET_YES; |
169 | 158 | ||
159 | MESSENGER_Application *app = (MESSENGER_Application*) cls; | ||
160 | |||
170 | const char *title; | 161 | const char *title; |
171 | title = GNUNET_CHAT_contact_get_name(contact); | 162 | title = GNUNET_CHAT_contact_get_name(contact); |
172 | 163 | ||
@@ -178,8 +169,6 @@ _iterate_contacts(void *cls, | |||
178 | entry->entry_box | 169 | entry->entry_box |
179 | ); | 170 | ); |
180 | 171 | ||
181 | GNUNET_CHAT_contact_set_user_pointer(contact, entry); | ||
182 | |||
183 | if (title) | 172 | if (title) |
184 | { | 173 | { |
185 | gtk_label_set_text(entry->title_label, title); | 174 | gtk_label_set_text(entry->title_label, title); |
@@ -324,12 +313,6 @@ ui_new_group_dialog_init(MESSENGER_Application *app, | |||
324 | 313 | ||
325 | GNUNET_CHAT_iterate_contacts( | 314 | GNUNET_CHAT_iterate_contacts( |
326 | app->chat.messenger.handle, | 315 | app->chat.messenger.handle, |
327 | _iterate_clear_contacts, | ||
328 | NULL | ||
329 | ); | ||
330 | |||
331 | GNUNET_CHAT_iterate_contacts( | ||
332 | app->chat.messenger.handle, | ||
333 | _iterate_contacts, | 316 | _iterate_contacts, |
334 | app | 317 | app |
335 | ); | 318 | ); |