aboutsummaryrefslogtreecommitdiff
path: root/src/chat/messenger.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/chat/messenger.c')
-rw-r--r--src/chat/messenger.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/chat/messenger.c b/src/chat/messenger.c
index 72ba93a..fc28490 100644
--- a/src/chat/messenger.c
+++ b/src/chat/messenger.c
@@ -52,7 +52,7 @@ _chat_messenger_idle(void *cls)
52 52
53static int 53static int
54_chat_messenger_message(void *cls, 54_chat_messenger_message(void *cls,
55 UNUSED struct GNUNET_CHAT_Context *context, 55 struct GNUNET_CHAT_Context *context,
56 const struct GNUNET_CHAT_Message *message) 56 const struct GNUNET_CHAT_Message *message)
57{ 57{
58 MESSENGER_Application *app = (MESSENGER_Application*) cls; 58 MESSENGER_Application *app = (MESSENGER_Application*) cls;
@@ -72,16 +72,23 @@ _chat_messenger_message(void *cls,
72 switch (kind) 72 switch (kind)
73 { 73 {
74 case GNUNET_CHAT_KIND_LOGIN: 74 case GNUNET_CHAT_KIND_LOGIN:
75 application_call_event(app, event_update_profile, NULL); 75 {
76 break; 76 application_call_event(app, event_update_profile, 0, NULL);
77 case GNUNET_CHAT_KIND_TEXT:
78 printf("text: %s\n", GNUNET_CHAT_message_get_text(message));
79 break; 77 break;
78 }
80 case GNUNET_CHAT_KIND_JOIN: 79 case GNUNET_CHAT_KIND_JOIN:
80 {
81 if (GNUNET_YES == GNUNET_CHAT_message_is_sent(message)) 81 if (GNUNET_YES == GNUNET_CHAT_message_is_sent(message))
82 application_call_event(app, event_update_chats, context); 82 application_call_event(app, event_update_chats, 1, (void**) &context);
83 83
84 break; 84 break;
85 }
86 case GNUNET_CHAT_KIND_TEXT:
87 {
88 void* event_data [2] = { context, &message };
89 application_call_event(app, event_receive_message, 2, event_data);
90 break;
91 }
85 default: 92 default:
86 break; 93 break;
87 } 94 }