silc_print(client, "*%s* %s", sender, msg);
}
+
+/* Notify message to the client. The `type' is the notify type received
+ from server. The `msg' is a human readable message sent by the server. */
+
+void silc_notify(SilcClient client, SilcClientConnection conn,
+ SilcNotifyType type, char *msg)
+{
+ silc_print(client, "*** %s", msg);
+}
+
/* Command handler. This function is called always in the command function.
If error occurs it will be called as well. `conn' is the associated
client connection. `cmd_context' is the command context that was
say: silc_say,
channel_message: silc_channel_message,
private_message: silc_private_message,
+ notify: silc_notify,
command: silc_command,
command_reply: silc_command_reply,
connect: silc_connect,
say: silc_say,
channel_message: silc_channel_message,
private_message: silc_private_message,
+ notify: silc_notify,
command: silc_command,
command_reply: silc_command_reply,
connect: silc_connect,
SilcBuffer message)
{
char *msg;
+ SilcNotifyType type;
+
+ SILC_GET16_MSB(type, message->data);
+ silc_buffer_pull(message, 2);
msg = silc_calloc(message->len + 1, sizeof(char));
memcpy(msg, message->data, message->len);
- client->ops->say(client, sock->user_data, msg);
+ client->ops->notify(client, sock->user_data, type, msg);
silc_free(msg);
}
id = silc_id_str2id(packet->dst_id, SILC_ID_CHANNEL);
- /* Find the channel entry from channels on this window */
+ /* Find the channel entry from channels on this connection */
if (!silc_idcache_find_by_id_one(conn->channel_cache, (void *)id,
SILC_ID_CHANNEL, &id_cache))
goto out;
char *sender, char *channel_name, char *msg);
void (*private_message)(SilcClient client, SilcClientConnection conn,
char *sender, char *msg);
+ void (*notify)(SilcClient client, SilcClientConnection conn,
+ SilcNotifyType type, char *msg);
void (*command)(SilcClient client, SilcClientConnection conn,
SilcClientCommandContext cmd_context, int success,
SilcCommand command);
sender received in the packet.
+ void (*notify)(SilcClient client, SilcClientConnection conn,
+ SilcNotifyType type, char *msg);
+
+ Notify message to the client. The `type' is the notify type received
+ from server. The `msg' is a human readable message sent by the server.
+
+
void (*command)(SilcClient client, SilcClientConnection conn,
SilcClientCommandContext cmd_context, int success,
SilcCommand command);