gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r6573 - GNUnet/src/applications/chat


From: gnunet
Subject: [GNUnet-SVN] r6573 - GNUnet/src/applications/chat
Date: Tue, 18 Mar 2008 12:48:29 -0600 (MDT)

Author: nevans
Date: 2008-03-18 12:48:26 -0600 (Tue, 18 Mar 2008)
New Revision: 6573

Modified:
   GNUnet/src/applications/chat/chat.h
   GNUnet/src/applications/chat/clientapi.c
   GNUnet/src/applications/chat/gnunet-chat.c
Log:


Modified: GNUnet/src/applications/chat/chat.h
===================================================================
--- GNUnet/src/applications/chat/chat.h 2008-03-18 16:39:06 UTC (rev 6572)
+++ GNUnet/src/applications/chat/chat.h 2008-03-18 18:48:26 UTC (rev 6573)
@@ -49,6 +49,13 @@
 
 } CS_chat_JOIN_MESSAGE;
 
+typedef struct
+{
+  GNUNET_MessageHeader header;
+  int nick_len;
+  char nick[1];
+
+} CS_chat_ROOM_MEMBER_MESSAGE;
 /**
  * Handle for a (joined) chat room.
  */
@@ -77,11 +84,15 @@
   char *memberInfo;
 
   GNUNET_CHAT_MessageCallback callback;
+  
+  GNUNET_CHAT_MessageCallback member_list_callback;
 
   int shutdown_flag;
 
   void *callback_cls;
 
+  void *member_list_callback_cls;
+
 };
 
 int GNUNET_CHAT_rejoin_room (struct GNUNET_CHAT_Room *chat_room);

Modified: GNUnet/src/applications/chat/clientapi.c
===================================================================
--- GNUnet/src/applications/chat/clientapi.c    2008-03-18 16:39:06 UTC (rev 
6572)
+++ GNUnet/src/applications/chat/clientapi.c    2008-03-18 18:48:26 UTC (rev 
6573)
@@ -146,7 +146,8 @@
                        const GNUNET_RSA_PublicKey * me,
                        const struct GNUNET_RSA_PrivateKey *key,
                        const char *memberInfo,
-                       GNUNET_CHAT_MessageCallback callback, void *cls)
+                       GNUNET_CHAT_MessageCallback callback, void *cls,
+                       GNUNET_CHAT_MemberListCallback memberCallback,void 
*membercls)
 {
   CS_chat_JOIN_MESSAGE *join_msg;
   GNUNET_HashCode hash_of_me;
@@ -196,6 +197,8 @@
   chat_room->my_private_key = key;
   chat_room->callback = callback;
   chat_room->callback_cls = cls;
+  chat_room->member_list_callback = memberCallback;
+  chat_room->member_list_callback_cls = membercls;
   chat_room->ectx = ectx;
   chat_room->cfg = cfg;
   chat_room->memberInfo = GNUNET_strdup(memberInfo);

Modified: GNUnet/src/applications/chat/gnunet-chat.c
===================================================================
--- GNUnet/src/applications/chat/gnunet-chat.c  2008-03-18 16:39:06 UTC (rev 
6572)
+++ GNUnet/src/applications/chat/gnunet-chat.c  2008-03-18 18:48:26 UTC (rev 
6573)
@@ -88,6 +88,12 @@
   return GNUNET_OK;
 }
 
+static int
+member_list_callback (void *cls,const char *senderNick, GNUNET_CronTime 
timestamp)
+{
+  return GNUNET_OK;
+}
+
 /**
  * Message delivery confirmations.
  *
@@ -130,8 +136,6 @@
   GNUNET_RSA_PublicKey my_pub;
   char message[MAX_MESSAGE_LENGTH + 1];
 
-  /* GNUNET_disable_entropy_gathering (); */
-
   if (GNUNET_SYSERR == GNUNET_init (argc,
                                     argv,
                                     "gnunet-chat [OPTIONS]",
@@ -153,7 +157,7 @@
                                 cfg,
                                 nickname, room_name,
                                 &my_pub, my_priv, "", &receive_callback,
-                                NULL);
+                                NULL,&member_list_callback,NULL);
   if (room == NULL)
     {
       fprintf (stderr, _("Failed to join room `%s'\n"), room_name);





reply via email to

[Prev in Thread] Current Thread [Next in Thread]