diff options
author | Christian Grothoff <christian@grothoff.org> | 2008-03-25 06:28:11 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2008-03-25 06:28:11 +0000 |
commit | b23b858a3827fb06959bcbcff7ef81055ce6f78c (patch) | |
tree | 31f5b1686a10d94ebedac2d586e0cadf7a908957 | |
parent | 5030aebe4d06b24c3b9c6be2e6442553578551d2 (diff) | |
download | gnunet-gtk-b23b858a3827fb06959bcbcff7ef81055ce6f78c.tar.gz gnunet-gtk-b23b858a3827fb06959bcbcff7ef81055ce6f78c.zip |
update to match API change
-rw-r--r-- | src/plugins/chat/chat.c | 38 |
1 files changed, 7 insertions, 31 deletions
diff --git a/src/plugins/chat/chat.c b/src/plugins/chat/chat.c index a5337417..626b202e 100644 --- a/src/plugins/chat/chat.c +++ b/src/plugins/chat/chat.c | |||
@@ -193,11 +193,11 @@ receive_callback (void *cls, | |||
193 | 193 | ||
194 | static int | 194 | static int |
195 | member_list_callback (void *cls, const char *senderNick, | 195 | member_list_callback (void *cls, const char *senderNick, |
196 | int is_joining, | ||
196 | GNUNET_CronTime timestamp) | 197 | GNUNET_CronTime timestamp) |
197 | { | 198 | { |
198 | struct GNUNET_CHAT_gui_chat_client *client = cls; | 199 | struct GNUNET_CHAT_gui_chat_client *client = cls; |
199 | GtkWidget *chatnicklist; | 200 | GtkWidget *chatnicklist; |
200 | |||
201 | struct GNUNET_CHAT_safe_nick_write_struct writearg; | 201 | struct GNUNET_CHAT_safe_nick_write_struct writearg; |
202 | 202 | ||
203 | chatnicklist = | 203 | chatnicklist = |
@@ -210,35 +210,12 @@ member_list_callback (void *cls, const char *senderNick, | |||
210 | /* chatnicklist is the GtkTextView object */ | 210 | /* chatnicklist is the GtkTextView object */ |
211 | writearg.nick = senderNick; | 211 | writearg.nick = senderNick; |
212 | writearg.nickList = chatnicklist; | 212 | writearg.nickList = chatnicklist; |
213 | 213 | ||
214 | g_print ("received nick %s calling safe write call\n", writearg.nick); | 214 | g_print ("received nick %s calling safe write call\n", writearg.nick); |
215 | 215 | if (is_joining) | |
216 | GNUNET_GTK_save_call (&write_nick_save_call, &writearg); | 216 | GNUNET_GTK_save_call (&write_nick_save_call, &writearg); |
217 | 217 | else | |
218 | return GNUNET_OK; | 218 | GNUNET_GTK_save_call (&remove_nick_save_call, &writearg); |
219 | } | ||
220 | |||
221 | static int | ||
222 | member_remove_callback (void *cls, const char *senderNick, | ||
223 | GNUNET_CronTime timestamp) | ||
224 | { | ||
225 | struct GNUNET_CHAT_gui_chat_client *client = cls; | ||
226 | GtkWidget *chatnicklist; | ||
227 | |||
228 | struct GNUNET_CHAT_safe_nick_write_struct writearg; | ||
229 | |||
230 | chatnicklist = | ||
231 | g_list_nth_data (gtk_container_get_children | ||
232 | (GTK_CONTAINER (client->chatFrame)), 1); | ||
233 | chatnicklist = | ||
234 | g_list_nth_data (gtk_container_get_children | ||
235 | (GTK_CONTAINER (chatnicklist)), 0); | ||
236 | |||
237 | /* chatnicklist is the GtkTextView object */ | ||
238 | writearg.nick = senderNick; | ||
239 | writearg.nickList = chatnicklist; | ||
240 | |||
241 | GNUNET_GTK_save_call (&remove_nick_save_call, &writearg); | ||
242 | 219 | ||
243 | return GNUNET_OK; | 220 | return GNUNET_OK; |
244 | } | 221 | } |
@@ -327,8 +304,7 @@ create_chat_room_tab (char *room_name, char *nick) | |||
327 | chatRoom = | 304 | chatRoom = |
328 | GNUNET_CHAT_join_room (chat_ectx, chat_cfg, nick, room_name, &pub_key, | 305 | GNUNET_CHAT_join_room (chat_ectx, chat_cfg, nick, room_name, &pub_key, |
329 | priv_key, "", &receive_callback, client, | 306 | priv_key, "", &receive_callback, client, |
330 | &member_list_callback, client, | 307 | &member_list_callback, client); |
331 | &member_remove_callback, client); | ||
332 | 308 | ||
333 | client->room = chatRoom; | 309 | client->room = chatRoom; |
334 | client->chatFrame = newChatWindow; | 310 | client->chatFrame = newChatWindow; |