1 <big><b>SilcNotifyType Arguments</b></big>
4 The SILC Client Library 'notify' client operation (which is part of the
5 SilcClientOperation callback functions) returns different kind of
6 notifications from the SILC server to the SILC client. The 'notify'
7 client operation implementation has a variable argument list to deliver
8 SilcNotifyType type specific arguments to the application. This document
9 describes these arguments for all notify types to help SILC client
10 software developers to handle the incoming notifications.
12 <br /> <br /> <br />
13 <b>notify Client Library operation</b>
16 The 'notify' client operation callback function prototype is as follows:
20 void (*notify)(SilcClient client, SilcClientConnection conn,
21 SilcNotifyType type, ...);
25 The first argument 'client' is the SILC Client Library context, the `conn'
26 is the context for the connection to the remote server, and the `type' is
27 the notify type enumeration sent by the server. Rest of the arguments are
28 `type' specific and implementation should handle them by the
29 SilcNotifyType for example in a <tt>switch</tt> statement. The notify
30 types are defined in lib/silccore/silcnotify.h header file. A short
35 switch(type)<br />
36 {<br />
37 case SILC_NOTIFY_TYPE_NONE:<br />
38 ...<br />
39 break;<br />
40 case SILC_NOTIFY_TYPE_INVITE:<br />
41 ...<br />
42 break;<br />
43 case SILC_NOTIFY_TYPE_JOIN:<br />
44 ...<br />
45 break;<br />
46 ...<br />
47 }
50 <br /> <br /> <br />
54 The following table describes all notify types and arguments that the
55 client library sends in the 'notify' client operation to the application.
56 By default all arguments that the libary sends to application are valid
57 pointers. However, it is possible that some pointers may be NULL. If
58 this is the case it is separately mentioned that the argument may be NULL.
59 In this case application must ignore that argument. The SilcNotifyType
60 arguments per notify type is as follows:
63 <table border="1" width="100%" cellpadding="5">
68 <td width="50%">Variable Arguments</td>
72 <td>SILC_NOTIFY_TYPE_NONE</td>
74 A message from server that usually does not include any critical
75 information. Application may ignore this or display it for the user.
76 The 'message' argument may be NULL.
78 <td width="50%">char *message</td>
82 <td>SILC_NOTIFY_TYPE_INVITE</td>
84 Sent to the client if the user is invited on a channel. The 'channel_name'
87 <td width="50%">SilcClientChannel channel, char *channel_name,
88 SilcClientEntry inviter
93 <td>SILC_NOTIFY_TYPE_JOIN</td>
95 Sent when someone joins to a channel.
97 <td width="50%">SilcClientEntry joining_client, SilcChannelEntry channel
102 <td>SILC_NOTIFY_TYPE_LEAVE</td>
104 Sent when someone leaves (parts) the channel.
106 <td width="50%">SilcClientEntry leaving_client, SilcChannelEntry channel
111 <td>SILC_NOTIFY_TYPE_SIGNOFF</td>
113 Sent when someone signoff the SILC network. The 'signoff_message' may be
114 NULL. The 'leaving_client' SilcClientEntry may be incomplete and contain
115 NULL pointers, application must check it's pointers before attempting to
116 display for example nickname information.
118 <td width="50%">SilcClientEntry signoff_client, char *signoff_message
123 <td>SILC_NOTIFY_TYPE_TOPIC_SET</td>
125 Sent when the topic of a channel is set/changed. The 'setter_id_type'
126 is used to check what type of pointer the 'setter_entry' is. For
127 SILC_ID_CLIENT SilcClientEntry, for SILC_ID_SERVER SilcServerEntry and for
128 SILC_ID_CHANNEL SilcChannelEntry.
130 <td width="50%">SilcIdType setter_id_type, void *setter_entry,
131 char *topic, SilcChannelEntry channel
136 <td>SILC_NOTIFY_TYPE_NICK_CHANGE</td>
138 Sent when someone changes their nickname. The 'old_client_entry' includes
139 the old nickname and the 'new_client_entry' includes the new nickname.
140 Application must understand that the 'old_client_entry' pointer becomes
141 invalid after returning from the function.
143 <td width="50%">SilcClientEntry old_client_entry,
144 SilcClientEntry new_client_entry
149 <td>SILC_NOTIFY_TYPE_CMODE_CHANGE</td>
151 Sent when channel's mode has changed. The 'changer_id_type'
152 is used to check what type of pointer the 'changer_entry' is. For
153 SILC_ID_CLIENT SilcClientEntry, for SILC_ID_SERVER SilcServerEntry and for
154 SILC_ID_CHANNEL SilcChannelEntry. The 'mode' is the mode mask after the
155 change. The 'hmac_name' argument may be NULL.
157 <td width="50%">SilcIdType changer_id_type, void *changer_entry,
158 SilcUInt32 mode, NULL, char *hmac_name, SilcChannelEntry channel
163 <td>SILC_NOTIFY_TYPE_CUMODE_CHANGE</td>
165 Sent when a users mode on a channel has changed. The 'changer_id_type'
166 is used to check what type of pointer the 'changer_entry' is. For
167 SILC_ID_CLIENT SilcClientEntry, for SILC_ID_SERVER SilcServerEntry and for
168 SILC_ID_CHANNEL SilcChannelEntry. The 'mode' is the mode mask after the
169 change. The 'target_client' is the client whose mode was changed.
171 <td width="50%">SilcIdType changer_id_type, void *changer_entry,
172 SilcUInt32 mode, SilcClientEntry target_client, SilcChannelEntry channel
177 <td>SILC_NOTIFY_TYPE_MOTD</td>
179 Message of the Day from the server.
181 <td width="50%">char *motd
186 <td>SILC_NOTIFY_TYPE_CHANNEL_CHANGE</td>
188 Sent when a channel's Channel ID changes. It is possible that channel's
189 ID changes and this notify is sent by the server when this happens.
190 Usually application does not need to handle this notify type and may
191 safely ignore it when received.
193 <td width="50%">SilcChannelEntry channel
198 <td>SILC_NOTIFY_TYPE_SERVER_SIGNOFF</td>
200 Sent when a server quits the network. The 'clients' is an array
201 SilcClientEntry pointers of size of 'clients_count'. Each client in the
202 entry is one client signing off from the SILC network.
204 <td width="50%">NULL, SilcClientEntry *clients, SilcUInt32 clients_count
209 <td>SILC_NOTIFY_TYPE_KICKED</td>
211 Sent when a client (possibly our client) is kicked from a channel. The
212 'kick_message' may be NULL. If our client was kicked then 'kicked' is our
213 local SilcClientEntry pointer.
215 <td width="50%">SilcClientEntry kicked, char *kick_message,
216 SilcClientEntry kicker, SilcChannelEntry channel
221 <td>SILC_NOTIFY_TYPE_KILLED</td>
223 Sent when a client (possibly our client) is killed from the network. The
224 'kill_message' may be NULL. If our client was killed then 'killed' is our
225 local SilcClientEntry pointer. The 'killer_type' is used to check what
226 type of pointer the 'killer' is. For SILC_ID_CLIENT SilcClientEntry, for
227 SILC_ID_SERVER SilcServerEntry and for SILC_ID_CHANNEL SilcChannelEntry.
229 <td width="50%">SilcClientEntry killed, char *kill_message,
230 SilcIdType killer_type, void *killer, SilcChannelEntry channel
235 <td>SILC_NOTIFY_TYPE_ERROR</td>
237 Sent when an error occurs while handling some operation (except command)
238 from the client. Application usually cannot handle this notify type and
239 may safely ignore it.
241 <td width="50%">SilcStatus error
246 <td>SILC_NOTIFY_TYPE_WATCH</td>
248 Sent to notify some status change of a client we are wathing. The
249 SILC_COMMAND_WATCH is used to manage clients we are wathing and this
250 notify type is used to deliver information about that client. If the
251 client just changed nickname the 'new_nickname' includes the new nickname.
252 Otherwise this pointer is NULL. The 'user_mode' is the client's mode in
253 the SILC network. The 'notification' contains the notify type that
254 happened for the 'watched_client' (for example
255 SILC_NOTIFY_TYPE_NICK_CHANGE if the client changed their nickname).
257 <td width="50%">SilcClientEntry watched_client, char *new_nickname,
258 SilcUInt32 user_mode, SilcNotifyType notification
265 SILC protocol defines some additional notify types but those notify types
266 are not delivered to the application. Some of those notify types are only
267 delivered between servers and routers and clients never receive them.
268 Only the notify types listed above are delivered to application.