diff options
Diffstat (limited to 'src/ui/messages.c')
-rw-r--r-- | src/ui/messages.c | 35 |
1 files changed, 10 insertions, 25 deletions
diff --git a/src/ui/messages.c b/src/ui/messages.c index ea771bc..52da9a7 100644 --- a/src/ui/messages.c +++ b/src/ui/messages.c | |||
@@ -27,21 +27,6 @@ | |||
27 | #include "../application.h" | 27 | #include "../application.h" |
28 | #include "../util.h" | 28 | #include "../util.h" |
29 | 29 | ||
30 | bool | ||
31 | _messages_filter_drop(const struct GNUNET_CHAT_Message *message) | ||
32 | { | ||
33 | enum GNUNET_CHAT_MessageKind kind = GNUNET_CHAT_message_get_kind(message); | ||
34 | |||
35 | switch (kind) { | ||
36 | case GNUNET_CHAT_KIND_CONTACT: | ||
37 | case GNUNET_CHAT_KIND_WHISPER: | ||
38 | case GNUNET_CHAT_KIND_DELETION: | ||
39 | return TRUE; | ||
40 | default: | ||
41 | return FALSE; | ||
42 | } | ||
43 | } | ||
44 | |||
45 | void | 30 | void |
46 | _messages_iterate(UI_MESSAGES_Handle *messages, | 31 | _messages_iterate(UI_MESSAGES_Handle *messages, |
47 | const struct GNUNET_CHAT_Message *message) | 32 | const struct GNUNET_CHAT_Message *message) |
@@ -67,13 +52,9 @@ messages_event(UI_MESSAGES_Handle *messages, | |||
67 | UI_MESSAGES_List *element = messages->head; | 52 | UI_MESSAGES_List *element = messages->head; |
68 | while (element) | 53 | while (element) |
69 | { | 54 | { |
70 | if (_messages_filter_drop(element->message)) | ||
71 | goto skip_message; | ||
72 | |||
73 | _messages_iterate(messages, element->message); | 55 | _messages_iterate(messages, element->message); |
74 | count++; | 56 | count++; |
75 | 57 | ||
76 | skip_message: | ||
77 | element = element->next; | 58 | element = element->next; |
78 | } | 59 | } |
79 | 60 | ||
@@ -285,13 +266,9 @@ messages_print(UI_MESSAGES_Handle *messages) | |||
285 | UI_MESSAGES_List *element = messages->head; | 266 | UI_MESSAGES_List *element = messages->head; |
286 | while (element) | 267 | while (element) |
287 | { | 268 | { |
288 | if (_messages_filter_drop(element->message)) | ||
289 | goto skip_message; | ||
290 | |||
291 | _messages_iterate_print(messages, element->message); | 269 | _messages_iterate_print(messages, element->message); |
292 | count++; | 270 | count++; |
293 | 271 | ||
294 | skip_message: | ||
295 | element = element->next; | 272 | element = element->next; |
296 | } | 273 | } |
297 | 274 | ||
@@ -358,8 +335,16 @@ void | |||
358 | messages_add(UI_MESSAGES_Handle *messages, | 335 | messages_add(UI_MESSAGES_Handle *messages, |
359 | const struct GNUNET_CHAT_Message *message) | 336 | const struct GNUNET_CHAT_Message *message) |
360 | { | 337 | { |
361 | if (GNUNET_CHAT_KIND_DELETION == GNUNET_CHAT_message_get_kind(message)) | 338 | enum GNUNET_CHAT_MessageKind kind = GNUNET_CHAT_message_get_kind(message); |
362 | return; | 339 | |
340 | switch (kind) { | ||
341 | case GNUNET_CHAT_KIND_CONTACT: | ||
342 | case GNUNET_CHAT_KIND_WHISPER: | ||
343 | case GNUNET_CHAT_KIND_DELETION: | ||
344 | return; | ||
345 | default: | ||
346 | break; | ||
347 | } | ||
363 | 348 | ||
364 | UI_MESSAGES_List *element = GNUNET_new(UI_MESSAGES_List); | 349 | UI_MESSAGES_List *element = GNUNET_new(UI_MESSAGES_List); |
365 | element->message = message; | 350 | element->message = message; |