/* FIXME: replace those printformat calls with signals and add signature
information to them (if present) */
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, message);
+ if(flags & SILC_MESSAGE_FLAG_UTF8 && !silc_term_utf8()) {
+ char tmp[256], *cp, *dm = NULL;
+ memset(tmp, 0, sizeof(tmp));
+ cp = tmp;
+ if(message_len > sizeof(tmp) - 1) {
+ dm = silc_calloc(message_len + 1, sizeof(*dm));
+ cp = dm;
+ }
+ silc_utf8_decode(message, message_len, SILC_STRING_LANGUAGE,
+ cp, message_len);
+ printformat_module("fe-common/silc", server, channel->channel_name,
+ MSGLEVEL_ACTIONS, SILCTXT_CHANNEL_ACTION,
+ nick == NULL ? "[<unknown>]" : nick->nick, cp);
+ silc_free(dm);
+ } else {
+ printformat_module("fe-common/silc", server, channel->channel_name,
+ MSGLEVEL_ACTIONS, SILCTXT_CHANNEL_ACTION,
+ 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, message);
+ if(flags & SILC_MESSAGE_FLAG_UTF8 && !silc_term_utf8()) {
+ char tmp[256], *cp, *dm = NULL;
+ memset(tmp, 0, sizeof(tmp));
+ cp = tmp;
+ if(message_len > sizeof(tmp) - 1) {
+ dm = silc_calloc(message_len + 1, sizeof(*dm));
+ cp = dm;
+ }
+ silc_utf8_decode(message, message_len, SILC_STRING_LANGUAGE,
+ cp, message_len);
+ printformat_module("fe-common/silc", server, channel->channel_name,
+ MSGLEVEL_NOTICES, SILCTXT_CHANNEL_NOTICE,
+ nick == NULL ? "[<unknown>]" : nick->nick, cp);
+ silc_free(dm);
+ } else {
+ printformat_module("fe-common/silc", server, channel->channel_name,
+ MSGLEVEL_NOTICES, SILCTXT_CHANNEL_NOTICE,
+ nick == NULL ? "[<unknown>]" : nick->nick,
+ message);
+ }
else {
if (flags & SILC_MESSAGE_FLAG_UTF8 && !silc_term_utf8()) {
char tmp[256], *cp, *dm = NULL;
message = (const unsigned char *)data;
} else {
silc_emit_mime_sig(server, NULL, data, data_len,
- enc, type, sender->nickname);
+ enc, type, sender->nickname ? sender->nickname :
+ "[<unknown>]");
message = NULL;
}
}
command_bind_silc("notice", MODULE_NAME, (SIGNAL_FUNC) command_notice);
command_bind_silc("away", MODULE_NAME, (SIGNAL_FUNC) command_away);
command_bind_silc("key", MODULE_NAME, (SIGNAL_FUNC) command_key);
- command_bind_silc("listkeys", MODULE_NAME, (SIGNAL_FUNC) command_listkeys);
+/* command_bind_silc("listkeys", MODULE_NAME, (SIGNAL_FUNC) command_listkeys); */
silc_nicklist_init();
}
command_unbind("notice", (SIGNAL_FUNC) command_notice);
command_unbind("away", (SIGNAL_FUNC) command_away);
command_unbind("key", (SIGNAL_FUNC) command_key);
- command_unbind("listkeys", (SIGNAL_FUNC) command_listkeys);
+/* command_unbind("listkeys", (SIGNAL_FUNC) command_listkeys); */
silc_nicklist_deinit();
}