void silc_channel_message(SilcClient client, SilcClientConnection conn,
SilcClientEntry sender, SilcChannelEntry channel,
- SilcMessageFlags flags, char *msg)
+ SilcMessageFlags flags, const unsigned char *message,
+ SilcUInt32 message_len)
{
SILC_SERVER_REC *server;
SILC_NICK_REC *nick;
SILC_LOG_DEBUG(("Start"));
- if (!msg)
+ if (!message)
return;
server = conn == NULL ? NULL : conn->context;
if (flags & SILC_MESSAGE_FLAG_ACTION)
printformat_module("fe-common/silc", server, channel->channel_name,
MSGLEVEL_ACTIONS, SILCTXT_CHANNEL_ACTION,
- nick == NULL ? "[<unknown>]" : nick->nick, msg);
+ nick == NULL ? "[<unknown>]" : nick->nick, message);
else if (flags & SILC_MESSAGE_FLAG_NOTICE)
printformat_module("fe-common/silc", server, channel->channel_name,
MSGLEVEL_NOTICES, SILCTXT_CHANNEL_NOTICE,
- nick == NULL ? "[<unknown>]" : nick->nick, msg);
+ nick == NULL ? "[<unknown>]" : nick->nick, message);
else
- signal_emit("message public", 6, server, msg,
+ signal_emit("message public", 6, server, message,
nick == NULL ? "[<unknown>]" : nick->nick,
nick == NULL ? "" : nick->host == NULL ? "" : nick->host,
chanrec->name, nick);
void silc_private_message(SilcClient client, SilcClientConnection conn,
SilcClientEntry sender, SilcMessageFlags flags,
- char *msg)
+ const unsigned char *message,
+ SilcUInt32 message_len)
{
SILC_SERVER_REC *server;
char userhost[256];
if (sender->username)
snprintf(userhost, sizeof(userhost) - 1, "%s@%s",
sender->username, sender->hostname);
- signal_emit("message private", 4, server, msg,
+ signal_emit("message private", 4, server, message,
sender->nickname ? sender->nickname : "[<unknown>]",
sender->username ? userhost : NULL);
}
client_entry = va_arg(va, SilcClientEntry);
tmp = va_arg(va, char *);
+ client_entry2 = va_arg(va, SilcClientEntry);
if (client_entry == conn->local_entry) {
printformat_module("fe-common/silc", server, NULL,
MSGLEVEL_CRAP, SILCTXT_CHANNEL_KILLED_YOU,
+ client_entry2 ? client_entry2->nickname : "",
tmp ? tmp : "");
} else {
list1 = nicklist_get_same_unique(SERVER(server), client_entry);
printformat_module("fe-common/silc", server, NULL,
MSGLEVEL_CRAP, SILCTXT_CHANNEL_KILLED,
client_entry->nickname,
+ client_entry2 ? client_entry2->nickname : "",
tmp ? tmp : "");
}
break;
SILC_SERVER_REC *server = conn->context;
if (!server && !success) {
- silc_client_close_connection(client, NULL, conn);
+ silc_client_close_connection(client, conn);
return;
}
if ((mode & SILC_UMODE_SERVER_OPERATOR) ||
(mode & SILC_UMODE_ROUTER_OPERATOR)) {
strcat(buf, (mode & SILC_UMODE_SERVER_OPERATOR) ?
- "Server Operator " :
+ "Server Operator" :
(mode & SILC_UMODE_ROUTER_OPERATOR) ?
- "SILC Operator " : "[Unknown mode] ");
+ "SILC Operator" : "[Unknown mode]");
}
if (mode & SILC_UMODE_GONE)
- strcat(buf, "away");
+ strcat(buf, " away");
+ if (mode & SILC_UMODE_INDISPOSED)
+ strcat(buf, " indisposed");
+ if (mode & SILC_UMODE_BUSY)
+ strcat(buf, " busy");
+ if (mode & SILC_UMODE_PAGE)
+ strcat(buf, " page to reach");
+ if (mode & SILC_UMODE_HYPER)
+ strcat(buf, " hyper active");
+ if (mode & SILC_UMODE_ROBOT)
+ strcat(buf, " robot");
+ if (mode & SILC_UMODE_ANONYMOUS)
+ strcat(buf, " anonymous");
+ if (mode & SILC_UMODE_BLOCK_PRIVMSG)
+ strcat(buf, " blocks private messages");
printformat_module("fe-common/silc", server, NULL, MSGLEVEL_CRAP,
SILCTXT_WHOIS_MODES, buf);
mode = silc_client_chumode_char(chu->mode);
if (e->mode & SILC_UMODE_GONE)
strcat(stat, "G");
- else
+ else if (e->mode & SILC_UMODE_INDISPOSED)
+ strcat(stat, "I");
+ else if (e->mode & SILC_UMODE_BUSY)
+ strcat(stat, "B");
+ else if (e->mode & SILC_UMODE_PAGE)
+ strcat(stat, "P");
+ else if (e->mode & SILC_UMODE_HYPER)
strcat(stat, "H");
+ else if (e->mode & SILC_UMODE_ROBOT)
+ strcat(stat, "R");
+ else if (e->mode & SILC_UMODE_ANONYMOUS)
+ strcat(stat, "?");
+ else
+ strcat(stat, "A");
if (mode)
strcat(stat, mode);
return FALSE;
}
+/* Notifies application that file transfer protocol session is being
+ requested by the remote client indicated by the `client_entry' from
+ the `hostname' and `port'. The `session_id' is the file transfer
+ session and it can be used to either accept or reject the file
+ transfer request, by calling the silc_client_file_receive or
+ silc_client_file_close, respectively. */
+
void silc_ftp(SilcClient client, SilcClientConnection conn,
SilcClientEntry client_entry, SilcUInt32 session_id,
const char *hostname, SilcUInt16 port)
client_entry->nickname, hostname, portstr);
}
+/* Delivers SILC session detachment data indicated by `detach_data' to the
+ application. If application has issued SILC_COMMAND_DETACH command
+ the client session in the SILC network is not quit. The client remains
+ in the network but is detached. The detachment data may be used later
+ to resume the session in the SILC Network. The appliation is
+ responsible of saving the `detach_data', to for example in a file.
+
+ The detachment data can be given as argument to the functions
+ silc_client_connect_to_server, or silc_client_add_connection when
+ creating connection to remote server, inside SilcClientConnectionParams
+ structure. If it is provided the client library will attempt to resume
+ the session in the network. After the connection is created
+ successfully, the application is responsible of setting the user
+ interface for user into the same state it was before detaching (showing
+ same channels, channel modes, etc). It can do this by fetching the
+ information (like joined channels) from the client library. */
+
+void
+silc_detach(SilcClient client, SilcClientConnection conn,
+ const unsigned char *detach_data, SilcUInt32 detach_data_len)
+{
+
+}
+
+
/* SILC client operations */
SilcClientOperations ops = {
silc_say,
silc_failure,
silc_key_agreement,
silc_ftp,
+ silc_detach,
};