mirror of
https://github.com/irssi/irssi.git
synced 2024-11-03 04:27:19 -05:00
Separated ctcp command/data in "message irc ctcp" signal and format. Added
/FORMAT ctcp_requestd_unknown. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2438 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
264e172abf
commit
926342839b
@ -302,7 +302,7 @@ fe-irc-messages.c:
|
||||
"message irc own_notice", SERVER_REC, char *msg, char *target
|
||||
"message irc notice", SERVER_REC, char *msg, char *nick, char *address, char *target
|
||||
"message irc own_ctcp", SERVER_REC, char *cmd, char *data, char *target
|
||||
"message irc ctcp", SERVER_REC, char *msg, char *nick, char *address, char *target
|
||||
"message irc ctcp", SERVER_REC, char *cmd, char *data, char *nick, char *address, char *target
|
||||
|
||||
dcc/fe-dcc-chat-messages.c:
|
||||
"message dcc own", DCC_REC *dcc, char *msg
|
||||
|
@ -33,44 +33,50 @@
|
||||
#include "window-items.h"
|
||||
#include "printtext.h"
|
||||
|
||||
static void ctcp_print(IRC_SERVER_REC *server,
|
||||
const char *prefix, const char *data,
|
||||
const char *nick, const char *addr, const char *target)
|
||||
{
|
||||
char *str;
|
||||
|
||||
str = *data == '\0' ? g_strdup(prefix) :
|
||||
g_strconcat(prefix, " ", data, NULL);
|
||||
signal_emit("message irc ctcp", 5, server, str, nick, addr, target);
|
||||
g_free(str);
|
||||
}
|
||||
|
||||
static void ctcp_default_msg(IRC_SERVER_REC *server, const char *data,
|
||||
const char *nick, const char *addr,
|
||||
const char *target)
|
||||
{
|
||||
ctcp_print(server, "unknown CTCP", data, nick, addr, target);
|
||||
const char *p;
|
||||
char *cmd;
|
||||
|
||||
p = strchr(data, ' ');
|
||||
if (p == NULL) {
|
||||
cmd = g_strdup(data);
|
||||
data = "";
|
||||
} else {
|
||||
cmd = g_strndup(data, (int) (p-data));
|
||||
data = p+1;
|
||||
}
|
||||
|
||||
printformat(server, ischannel(*target) ? target : nick, MSGLEVEL_CTCPS,
|
||||
IRCTXT_CTCP_REQUESTED_UNKNOWN,
|
||||
nick, addr, cmd, data, target);
|
||||
g_free(cmd);
|
||||
}
|
||||
|
||||
static void ctcp_ping_msg(IRC_SERVER_REC *server, const char *data,
|
||||
const char *nick, const char *addr,
|
||||
const char *target)
|
||||
{
|
||||
ctcp_print(server, "CTCP PING", data, nick, addr, target);
|
||||
signal_emit("message irc ctcp", 6, server, "PING",
|
||||
data, nick, addr, target);
|
||||
}
|
||||
|
||||
static void ctcp_version_msg(IRC_SERVER_REC *server, const char *data,
|
||||
const char *nick, const char *addr,
|
||||
const char *target)
|
||||
{
|
||||
ctcp_print(server, "CTCP VERSION", data, nick, addr, target);
|
||||
signal_emit("message irc ctcp", 6, server, "VERSION",
|
||||
data, nick, addr, target);
|
||||
}
|
||||
|
||||
static void ctcp_time_msg(IRC_SERVER_REC *server, const char *data,
|
||||
const char *nick, const char *addr,
|
||||
const char *target)
|
||||
{
|
||||
ctcp_print(server, "CTCP TIME", data, nick, addr, target);
|
||||
signal_emit("message irc ctcp", 6, server, "TIME",
|
||||
data, nick, addr, target);
|
||||
}
|
||||
|
||||
static void ctcp_default_reply(IRC_SERVER_REC *server, const char *data,
|
||||
|
@ -229,12 +229,12 @@ static void sig_message_own_ctcp(IRC_SERVER_REC *server, const char *cmd,
|
||||
IRCTXT_OWN_CTCP, target, cmd, data);
|
||||
}
|
||||
|
||||
static void sig_message_irc_ctcp(IRC_SERVER_REC *server, const char *msg,
|
||||
const char *nick, const char *addr,
|
||||
const char *target)
|
||||
static void sig_message_irc_ctcp(IRC_SERVER_REC *server, const char *cmd,
|
||||
const char *data, const char *nick,
|
||||
const char *addr, const char *target)
|
||||
{
|
||||
printformat(server, ischannel(*target) ? target : nick, MSGLEVEL_CTCPS,
|
||||
IRCTXT_CTCP_REQUESTED, nick, addr, msg, target);
|
||||
IRCTXT_CTCP_REQUESTED, nick, addr, cmd, data, target);
|
||||
}
|
||||
|
||||
void fe_irc_messages_init(void)
|
||||
|
@ -138,7 +138,8 @@ FORMAT_REC fecommon_irc_formats[] = {
|
||||
{ "ctcp_reply", "CTCP {hilight $0} reply from {nick $1}: $2", 3, { 0, 0, 0 } },
|
||||
{ "ctcp_reply_channel", "CTCP {hilight $0} reply from {nick $1} in channel {channel $3}: $2", 4, { 0, 0, 0, 0 } },
|
||||
{ "ctcp_ping_reply", "CTCP {hilight PING} reply from {nick $0}: $1.$[-3.0]2 seconds", 3, { 0, 2, 2 } },
|
||||
{ "ctcp_requested", "{ctcp {hilight $0} {comment $1} requested {hilight $2} from {nick $3}}", 4, { 0, 0, 0, 0 } },
|
||||
{ "ctcp_requested", "{ctcp {hilight $0} {comment $1} requested CTCP {hilight $2} from {nick $4}}: $3", 5, { 0, 0, 0, 0, 0 } },
|
||||
{ "ctcp_requested_unknown", "{ctcp {hilight $0} {comment $1} requested unknown CTCP {hilight $2} from {nick $4}}: $3", 5, { 0, 0, 0, 0, 0 } },
|
||||
|
||||
/* ---- */
|
||||
{ NULL, "Other server events", 0 },
|
||||
|
@ -111,6 +111,7 @@ enum {
|
||||
IRCTXT_CTCP_REPLY_CHANNEL,
|
||||
IRCTXT_CTCP_PING_REPLY,
|
||||
IRCTXT_CTCP_REQUESTED,
|
||||
IRCTXT_CTCP_REQUESTED_UNKNOWN,
|
||||
|
||||
IRCTXT_FILL_10,
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user