aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_chat_service.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-02-06 23:27:01 +0000
committerChristian Grothoff <christian@grothoff.org>2011-02-06 23:27:01 +0000
commita0b3e179abb44828f76843739487b2686b14cc8e (patch)
tree52b2cfb63a66b13ce39bd1bf8bed04ff74ae102a /src/include/gnunet_chat_service.h
parent7b3d9e8f57db9db2053dd7e25c9dbd92514819e0 (diff)
downloadgnunet-a0b3e179abb44828f76843739487b2686b14cc8e.tar.gz
gnunet-a0b3e179abb44828f76843739487b2686b14cc8e.zip
more chat code from Mantis #1657
Diffstat (limited to 'src/include/gnunet_chat_service.h')
-rw-r--r--src/include/gnunet_chat_service.h21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/include/gnunet_chat_service.h b/src/include/gnunet_chat_service.h
index 059dff254..732d625f2 100644
--- a/src/include/gnunet_chat_service.h
+++ b/src/include/gnunet_chat_service.h
@@ -89,6 +89,14 @@ enum GNUNET_CHAT_MsgOptions
89struct GNUNET_CHAT_Room; 89struct GNUNET_CHAT_Room;
90 90
91/** 91/**
92 * Callback used for notification that we have joined the room.
93 *
94 * @param cls closure
95 * @return GNUNET_OK
96 */
97typedef int (*GNUNET_CHAT_JoinCallback) (void *cls);
98
99/**
92 * Callback used for notification about incoming messages. 100 * Callback used for notification about incoming messages.
93 * 101 *
94 * @param cls closure 102 * @param cls closure
@@ -96,6 +104,7 @@ struct GNUNET_CHAT_Room;
96 * @param sender what is the ID of the sender? (maybe NULL) 104 * @param sender what is the ID of the sender? (maybe NULL)
97 * @param member_info information about the joining member 105 * @param member_info information about the joining member
98 * @param message the message text 106 * @param message the message text
107 * @param timestamp when was the message sent?
99 * @param options options for the message 108 * @param options options for the message
100 * @return GNUNET_OK to accept the message now, GNUNET_NO to 109 * @return GNUNET_OK to accept the message now, GNUNET_NO to
101 * accept (but user is away), GNUNET_SYSERR to signal denied delivery 110 * accept (but user is away), GNUNET_SYSERR to signal denied delivery
@@ -105,11 +114,13 @@ typedef int (*GNUNET_CHAT_MessageCallback) (void *cls,
105 const GNUNET_HashCode *sender, 114 const GNUNET_HashCode *sender,
106 const struct GNUNET_CONTAINER_MetaData *member_info, 115 const struct GNUNET_CONTAINER_MetaData *member_info,
107 const char *message, 116 const char *message,
117 struct GNUNET_TIME_Absolute timestamp,
108 enum GNUNET_CHAT_MsgOptions options); 118 enum GNUNET_CHAT_MsgOptions options);
109 119
110/** 120/**
111 * Callback used for notification that another room member has joined or left. 121 * Callback used for notification that another room member has joined or left.
112 * 122 *
123 * @param cls closure
113 * @param member_info will be non-null if the member is joining, NULL if he is 124 * @param member_info will be non-null if the member is joining, NULL if he is
114 * leaving 125 * leaving
115 * @param member_id hash of public key of the user (for unique identification) 126 * @param member_id hash of public key of the user (for unique identification)
@@ -129,8 +140,6 @@ typedef int (*GNUNET_CHAT_MemberListCallback) (void *cls,
129 * @param orig_seq_number sequence number of the original message 140 * @param orig_seq_number sequence number of the original message
130 * @param timestamp when was the message received? 141 * @param timestamp when was the message received?
131 * @param receiver who is confirming the receipt? 142 * @param receiver who is confirming the receipt?
132 * @param msg_hash hash of the original message
133 * @param receipt signature confirming delivery
134 * @return GNUNET_OK to continue, GNUNET_SYSERR to refuse processing further 143 * @return GNUNET_OK to continue, GNUNET_SYSERR to refuse processing further
135 * confirmations from anyone for this message 144 * confirmations from anyone for this message
136 */ 145 */
@@ -138,9 +147,7 @@ typedef int (*GNUNET_CHAT_MessageConfirmation) (void *cls,
138 struct GNUNET_CHAT_Room *room, 147 struct GNUNET_CHAT_Room *room,
139 uint32_t orig_seq_number, 148 uint32_t orig_seq_number,
140 struct GNUNET_TIME_Absolute timestamp, 149 struct GNUNET_TIME_Absolute timestamp,
141 const GNUNET_HashCode *receiver, 150 const GNUNET_HashCode *receiver);
142 const GNUNET_HashCode *msg_hash,
143 const struct GNUNET_CRYPTO_RsaSignature *receipt);
144 151
145/** 152/**
146 * Join a chat room. 153 * Join a chat room.
@@ -153,6 +160,8 @@ typedef int (*GNUNET_CHAT_MessageConfirmation) (void *cls,
153 * @param member_info information about the joining member 160 * @param member_info information about the joining member
154 * @param room_name name of the room 161 * @param room_name name of the room
155 * @param msg_options message options of the joining user 162 * @param msg_options message options of the joining user
163 * @param joinCallback which function to call when we've joined the room
164 * @param join_cls argument to callback
156 * @param messageCallback which function to call if a message has 165 * @param messageCallback which function to call if a message has
157 * been received? 166 * been received?
158 * @param message_cls argument to callback 167 * @param message_cls argument to callback
@@ -170,6 +179,8 @@ GNUNET_CHAT_join_room (const struct GNUNET_CONFIGURATION_Handle *cfg,
170 struct GNUNET_CONTAINER_MetaData *member_info, 179 struct GNUNET_CONTAINER_MetaData *member_info,
171 const char *room_name, 180 const char *room_name,
172 enum GNUNET_CHAT_MsgOptions msg_options, 181 enum GNUNET_CHAT_MsgOptions msg_options,
182 GNUNET_CHAT_JoinCallback joinCallback,
183 void *join_cls,
173 GNUNET_CHAT_MessageCallback messageCallback, 184 GNUNET_CHAT_MessageCallback messageCallback,
174 void *message_cls, 185 void *message_cls,
175 GNUNET_CHAT_MemberListCallback memberCallback, 186 GNUNET_CHAT_MemberListCallback memberCallback,