server = conn == NULL ? NULL : conn->context;
chanrec = silc_channel_find_entry(server, channel);
+ if (!chanrec)
+ return;
nick = silc_nicklist_find(chanrec, sender);
if (flags & SILC_MESSAGE_FLAG_ACTION)
printformat_module("fe-common/silc", server, channel->channel_name,
- MSGLEVEL_ACTIONS, SILCTXT_CHANNEL_ACTION, msg);
+ MSGLEVEL_ACTIONS, SILCTXT_CHANNEL_ACTION,
+ nick == NULL ? "[<unknown>]" : nick->nick, msg);
else if (flags & SILC_MESSAGE_FLAG_NOTICE)
printformat_module("fe-common/silc", server, channel->channel_name,
- MSGLEVEL_NOTICES, SILCTXT_CHANNEL_NOTICE, msg);
+ MSGLEVEL_NOTICES, SILCTXT_CHANNEL_NOTICE,
+ nick == NULL ? "[<unknown>]" : nick->nick, msg);
else
signal_emit("message public", 6, server, msg,
nick == NULL ? "[<unknown>]" : nick->nick,
- nick == NULL ? NULL : nick->host,
+ nick == NULL ? "" : nick->host == NULL ? "" : nick->host,
chanrec->name, nick);
}
or connecting failed. This is also the first time application receives
the SilcClientConnection objecet which it should save somewhere. */
-void silc_connect(SilcClient client, SilcClientConnection conn, int success)
+void silc_connect(SilcClient client, SilcClientConnection conn, int success)
{
SILC_SERVER_REC *server = conn->context;
SilcClientCommandContext cmd_context, int success,
SilcCommand command)
{
+ SILC_SERVER_REC *server = conn->context;
+
+ if (!success)
+ return;
+
+ switch(command) {
+ case SILC_COMMAND_INVITE:
+ printformat_module("fe-common/silc", server, NULL,
+ MSGLEVEL_CRAP, SILCTXT_CHANNEL_INVITING,
+ cmd_context->argv[2],
+ (cmd_context->argv[1][0] == '*' ?
+ (char *)conn->current_channel->channel_name :
+ (char *)cmd_context->argv[1]));
+ break;
+ default:
+ break;
+ }
}
/* Client info resolving callback when JOIN command reply is received.
{
SilcChannelEntry channel;
char *invite_list;
+ SilcArgumentPayload args;
+ int argc = 0;
if (!success)
return;
channel = va_arg(vp, SilcChannelEntry);
invite_list = va_arg(vp, char *);
-
+
+ args = silc_command_get_args(cmd_payload);
+ if (args)
+ argc = silc_argument_get_arg_num(args);
+
if (invite_list)
printformat_module("fe-common/silc", server, NULL, MSGLEVEL_CRAP,
SILCTXT_CHANNEL_INVITE_LIST, channel->channel_name,
invite_list);
- else
+ else if (argc == 3)
printformat_module("fe-common/silc", server, NULL, MSGLEVEL_CRAP,
SILCTXT_CHANNEL_NO_INVITE_LIST,
channel->channel_name);
SilcBuffer client_id_list;
uint32 list_count;
+ if (!success)
+ return;
+
channel = va_arg(vp, char *);
channel_entry = va_arg(vp, SilcChannelEntry);
modei = va_arg(vp, uint32);
list_count = va_arg(vp, uint32);
client_id_list = va_arg(vp, SilcBuffer);
- if (!success)
- return;
-
chanrec = silc_channel_find(server, channel);
if (chanrec != NULL && !success)
channel_destroy(CHANNEL(chanrec));
signal_emit("channel topic changed", 1, chanrec);
}
- mode = silc_client_chmode(modei, channel_entry);
+ mode = silc_client_chmode(modei,
+ channel_entry->channel_key->cipher->name,
+ channel_entry->hmac->hmac->name);
g_free_not_null(chanrec->mode);
chanrec->mode = g_strdup(mode == NULL ? "" : mode);
signal_emit("channel mode changed", 1, chanrec);
unsigned char *pk;
uint32 pk_len;
+ if (!success)
+ return;
+
id_type = va_arg(vp, uint32);
entry = va_arg(vp, void *);
public_key = va_arg(vp, SilcPublicKey);
NULL, NULL);
silc_free(pk);
}
+ break;
case SILC_COMMAND_TOPIC:
{
printformat_module("fe-common/silc", server, channel->channel_name,
MSGLEVEL_CRAP, SILCTXT_CHANNEL_TOPIC,
channel->channel_name, topic);
+ } else {
+ printformat_module("fe-common/silc", server, channel->channel_name,
+ MSGLEVEL_CRAP, SILCTXT_CHANNEL_TOPIC_NOT_SET,
+ channel->channel_name);
}
}
break;