[srvx-commits] CVS: services/src proto-p10.c,1.16,1.17
Brought to you by:
entrope
|
From: Zoot <zo...@us...> - 2002-08-13 21:17:45
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv24600/src
Modified Files:
proto-p10.c
Log Message:
Make tokenized P10 protocol output an option; merge in new commands from ircu 2.10.11.
Index: proto-p10.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-p10.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -r1.16 -r1.17
*** proto-p10.c 13 Aug 2002 03:04:07 -0000 1.16
--- proto-p10.c 13 Aug 2002 21:17:25 -0000 1.17
***************
*** 21,159 ****
#include "proto-common.c"
! #define CMD_ACCOUNT "ACCOUNT"
! #define CMD_ADMIN "ADMIN"
! #define CMD_AWAY "AWAY"
! #define CMD_BURST "BURST"
! #define CMD_CLOSE "CLOSE"
! #define CMD_CNOTICE "CNOTICE"
! #define CMD_CONNECT "CONNECT"
! #define CMD_CPRIVMSG "CPRIVMSG"
! #define CMD_CREATE "CREATE"
! #define CMD_DESTRUCT "DESTRUCT"
! #define CMD_DESYNCH "DESYNCH"
! #define CMD_DIE "DIE"
! #define CMD_DNS "DNS"
! #define CMD_EOB "END_OF_BURST"
! #define CMD_EOB_ACK "EOB_ACK"
! #define CMD_ERROR "ERROR"
! #define CMD_GLINE "GLINE"
! #define CMD_HASH "HASH"
! #define CMD_HELP "HELP"
! #define CMD_INFO "INFO"
! #define CMD_INVITE "INVITE"
! #define CMD_ISON "ISON"
! #define CMD_JOIN "JOIN"
! #define CMD_JUPE "JUPE"
! #define CMD_KICK "KICK"
! #define CMD_KILL "KILL"
! #define CMD_LINKS "LINKS"
! #define CMD_LIST "LIST"
! #define CMD_LUSERS "LUSERS"
! #define CMD_MAP "MAP"
! #define CMD_MODE "MODE"
! #define CMD_MOTD "MOTD"
! #define CMD_NAMES "NAMES"
! #define CMD_NICK "NICK"
! #define CMD_NOTICE "NOTICE"
! #define CMD_OPER "OPER"
! #define CMD_PART "PART"
! #define CMD_PASS "PASS"
! #define CMD_PING "PING"
! #define CMD_PONG "PONG"
! #define CMD_PRIVMSG "PRIVMSG"
! #define CMD_QUIT "QUIT"
! #define CMD_REHASH "REHASH"
! #define CMD_RESTART "RESTART"
! #define CMD_RPING "RPING"
! #define CMD_RPONG "RPONG"
! #define CMD_SERVER "SERVER"
! #define CMD_SERVLIST "SERVLIST"
! #define CMD_SERVSET "SERVSET"
! #define CMD_SETTIME "SETTIME"
! #define CMD_SILENCE "SILENCE"
! #define CMD_SQUERY "SQUERY"
! #define CMD_SQUIT "SQUIT"
! #define CMD_STATS "STATS"
! #define CMD_TIME "TIME"
! #define CMD_TOPIC "TOPIC"
! #define CMD_TRACE "TRACE"
! #define CMD_UPING "UPING"
! #define CMD_USER "USER"
! #define CMD_USERHOST "USERHOST"
! #define CMD_USERIP "USERIP"
! #define CMD_VERSION "VERSION"
! #define CMD_WALLCHOPS "WALLCHOPS"
! #define CMD_WALLOPS "WALLOPS"
! #define CMD_WHO "WHO"
! #define CMD_WHOIS "WHOIS"
! #define CMD_WHOWAS "WHOWAS"
!
! #define TOK_ACCOUNT "AC"
! #define TOK_ADMIN "AD"
! #define TOK_AWAY "A"
! #define TOK_BURST "B"
! #define TOK_CLOSE "CLOSE"
! #define TOK_CNOTICE "CN"
! #define TOK_CONNECT "CO"
! #define TOK_CPRIVMSG "CP"
! #define TOK_CREATE "C"
! #define TOK_DESTRUCT "DE"
! #define TOK_DESYNCH "DS"
! #define TOK_DIE "DIE"
! #define TOK_DNS "DNS"
! #define TOK_EOB "EB"
! #define TOK_EOB_ACK "EA"
! #define TOK_ERROR "Y"
! #define TOK_GLINE "GL"
! #define TOK_HASH "HASH"
! #define TOK_HELP "HELP"
! #define TOK_INFO "F"
! #define TOK_INVITE "I"
! #define TOK_ISON "ISON"
! #define TOK_JOIN "J"
! #define TOK_JUPE "JU"
! #define TOK_KICK "K"
! #define TOK_KILL "D"
! #define TOK_LINKS "LI"
! #define TOK_LIST "LIST"
! #define TOK_LUSERS "LU"
! #define TOK_MAP "MAP"
! #define TOK_MODE "M"
! #define TOK_MOTD "MO"
! #define TOK_NAMES "E"
! #define TOK_NICK "N"
! #define TOK_NOTICE "O"
! #define TOK_OPER "OPER"
! #define TOK_PART "L"
! #define TOK_PASS "PASS"
! #define TOK_PING "G"
! #define TOK_PONG "Z"
! #define TOK_PRIVMSG "P"
! #define TOK_QUIT "Q"
! #define TOK_REHASH "REHASH"
! #define TOK_RESTART "RESTART"
! #define TOK_RPING "RI"
! #define TOK_RPONG "RO"
! #define TOK_SERVER "S"
! #define TOK_SERVLIST "SERVLIST"
! #define TOK_SERVSET "SERVSET"
! #define TOK_SETTIME "SE"
! #define TOK_SILENCE "U"
! #define TOK_SQUERY "SQUERY"
! #define TOK_SQUIT "SQ"
! #define TOK_STATS "R"
! #define TOK_TIME "TI"
! #define TOK_TOPIC "T"
! #define TOK_TRACE "TR"
! #define TOK_UPING "UPING"
! #define TOK_USER "USER"
! #define TOK_USERHOST "USERHOST"
! #define TOK_USERIP "USERIP"
! #define TOK_VERSION "V"
! #define TOK_WALLCHOPS "WC"
! #define TOK_WALLOPS "WA"
! #define TOK_WHO "H"
! #define TOK_WHOIS "W"
! #define TOK_WHOWAS "X"
/* Servers claiming to have a boot or link time before PREHISTORY
--- 21,348 ----
#include "proto-common.c"
! /* Protocol messages; aliased to full commands or tokens depending
! on compile-time configuration. ircu 2.10.11 requires tokens
! WITH THE EXCEPTION OF THE FOLLOWING:
! PASS
! SERVER
!
! For some reason, ircu 2.10.11 does not parse the tokenized forms
! of these commands.
! */
! #ifdef ENABLE_TOKENS
! #define P10_ACCOUNT TOK_ACCOUNT
! #define P10_ADMIN TOK_ADMIN
! #define P10_ASLL TOK_ASLL
! #define P10_AWAY TOK_AWAY
! #define P10_BURST TOK_BURST
! #define P10_CLEARMODE TOK_CLEARMODE
! #define P10_CLOSE TOK_CLOSE
! #define P10_CNOTICE TOK_CNOTICE
! #define P10_CONNECT TOK_CONNECT
! #define P10_CPRIVMSG TOK_CPRIVMSG
! #define P10_CREATE TOK_CREATE
! #define P10_DESTRUCT TOK_DESTRUCT
! #define P10_DESYNCH TOK_DESYNCH
! #define P10_DIE TOK_DIE
! #define P10_DNS TOK_DNS
! #define P10_EOB TOK_EOB
! #define P10_EOB_ACK TOK_EOB_ACK
! #define P10_ERROR TOK_ERROR
! #define P10_GET TOK_GET
! #define P10_GLINE TOK_GLINE
! #define P10_HASH TOK_HASH
! #define P10_HELP TOK_HELP
! #define P10_INFO TOK_INFO
! #define P10_INVITE TOK_INVITE
! #define P10_ISON TOK_ISON
! #define P10_JOIN TOK_JOIN
! #define P10_JUPE TOK_JUPE
! #define P10_KICK TOK_KICK
! #define P10_KILL TOK_KILL
! #define P10_LINKS TOK_LINKS
! #define P10_LIST TOK_LIST
! #define P10_LUSERS TOK_LUSERS
! #define P10_MAP TOK_MAP
! #define P10_MODE TOK_MODE
! #define P10_MOTD TOK_MOTD
! #define P10_NAMES TOK_NAMES
! #define P10_NICK TOK_NICK
! #define P10_NOTICE TOK_NOTICE
! #define P10_OPER TOK_OPER
! #define P10_OPMODE TOK_OPMODE
! #define P10_PART TOK_PART
! #define P10_PASS CMD_PASS
! #define P10_PING TOK_PING
! #define P10_PONG TOK_PONG
! #define P10_POST TOK_POST
! #define P10_PRIVMSG TOK_PRIVMSG
! #define P10_PRIVS TOK_PRIVS
! #define P10_PROTO TOK_PROTO
! #define P10_QUIT TOK_QUIT
! #define P10_REHASH TOK_REHASH
! #define P10_RESET TOK_RESET
! #define P10_RESTART TOK_RESTART
! #define P10_RPING TOK_RPING
! #define P10_RPONG TOK_RPONG
! #define P10_SERVER CMD_SERVER
! #define P10_SERVLIST TOK_SERVLIST
! #define P10_SERVSET TOK_SERVSET
! #define P10_SET TOK_SET
! #define P10_SETTIME TOK_SETTIME
! #define P10_SILENCE TOK_SILENCE
! #define P10_SQUERY TOK_SQUERY
! #define P10_SQUIT TOK_SQUIT
! #define P10_STATS TOK_STATS
! #define P10_TIME TOK_TIME
! #define P10_TOPIC TOK_TOPIC
! #define P10_TRACE TOK_TRACE
! #define P10_UPING TOK_UPING
! #define P10_USER TOK_USER
! #define P10_USERHOST TOK_USERHOST
! #define P10_USERIP TOK_USERIP
! #define P10_VERSION TOK_VERSION
! #define P10_WALLCHOPS TOK_WALLCHOPS
! #define P10_WALLOPS TOK_WALLOPS
! #define P10_WALLUSERS TOK_WALLUSERS
! #define P10_WHO TOK_WHO
! #define P10_WHOIS TOK_WHOIS
! #define P10_WHOWAS TOK_WHOWAS
! #else /* !ENABLE_TOKENS */
! #define P10_ACCOUNT CMD_ACCOUNT
! #define P10_ADMIN CMD_ADMIN
! #define P10_ASLL CMD_ASLL
! #define P10_AWAY CMD_AWAY
! #define P10_BURST CMD_BURST
! #define P10_CLEARMODE CMD_CLEARMODE
! #define P10_CLOSE CMD_CLOSE
! #define P10_CNOTICE CMD_CNOTICE
! #define P10_CONNECT CMD_CONNECT
! #define P10_CPRIVMSG CMD_CPRIVMSG
! #define P10_CREATE CMD_CREATE
! #define P10_DESTRUCT CMD_DESTRUCT
! #define P10_DESYNCH CMD_DESYNCH
! #define P10_DIE CMD_DIE
! #define P10_DNS CMD_DNS
! #define P10_EOB CMD_EOB
! #define P10_EOB_ACK CMD_EOB_ACK
! #define P10_ERROR CMD_ERROR
! #define P10_GET CMD_GET
! #define P10_GLINE CMD_GLINE
! #define P10_HASH CMD_HASH
! #define P10_HELP CMD_HELP
! #define P10_INFO CMD_INFO
! #define P10_INVITE CMD_INVITE
! #define P10_ISON CMD_ISON
! #define P10_JOIN CMD_JOIN
! #define P10_JUPE CMD_JUPE
! #define P10_KICK CMD_KICK
! #define P10_KILL CMD_KILL
! #define P10_LINKS CMD_LINKS
! #define P10_LIST CMD_LIST
! #define P10_LUSERS CMD_LUSERS
! #define P10_MAP CMD_MAP
! #define P10_MODE CMD_MODE
! #define P10_MOTD CMD_MOTD
! #define P10_NAMES CMD_NAMES
! #define P10_NICK CMD_NICK
! #define P10_NOTICE CMD_NOTICE
! #define P10_OPER CMD_OPER
! #define P10_OPMODE CMD_OPMODE
! #define P10_PART CMD_PART
! #define P10_PASS CMD_PASS
! #define P10_PING CMD_PING
! #define P10_PONG CMD_PONG
! #define P10_POST CMD_POST
! #define P10_PRIVMSG CMD_PRIVMSG
! #define P10_PRIVS CMD_PRIVS
! #define P10_PROTO CMD_PROTO
! #define P10_QUIT CMD_QUIT
! #define P10_REHASH CMD_REHASH
! #define P10_RESET CMD_RESET
! #define P10_RESTART CMD_RESTART
! #define P10_RPING CMD_RPING
! #define P10_RPONG CMD_RPONG
! #define P10_SERVER CMD_SERVER
! #define P10_SERVLIST CMD_SERVLIST
! #define P10_SERVSET CMD_SERVSET
! #define P10_SET CMD_SET
! #define P10_SETTIME CMD_SETTIME
! #define P10_SILENCE CMD_SILENCE
! #define P10_SQUERY CMD_SQUERY
! #define P10_SQUIT CMD_SQUIT
! #define P10_STATS CMD_STATS
! #define P10_TIME CMD_TIME
! #define P10_TOPIC CMD_TOPIC
! #define P10_TRACE CMD_TRACE
! #define P10_UPING CMD_UPING
! #define P10_USER CMD_USER
! #define P10_USERHOST CMD_USERHOST
! #define P10_USERIP CMD_USERIP
! #define P10_VERSION CMD_VERSION
! #define P10_WALLCHOPS CMD_WALLCHOPS
! #define P10_WALLOPS CMD_WALLOPS
! #define P10_WALLUSERS CMD_WALLUSERS
! #define P10_WHO CMD_WHO
! #define P10_WHOIS CMD_WHOIS
! #define P10_WHOWAS CMD_WHOWAS
! #endif /* ENABLE_TOKENS */
!
! /* Full commands. */
! #define CMD_ACCOUNT "ACCOUNT"
! #define CMD_ADMIN "ADMIN"
! #define CMD_ASLL "ASLL"
! #define CMD_AWAY "AWAY"
! #define CMD_BURST "BURST"
! #define CMD_CLEARMODE "CLEARMODE"
! #define CMD_CLOSE "CLOSE"
! #define CMD_CNOTICE "CNOTICE"
! #define CMD_CONNECT "CONNECT"
! #define CMD_CPRIVMSG "CPRIVMSG"
! #define CMD_CREATE "CREATE"
! #define CMD_DESTRUCT "DESTRUCT"
! #define CMD_DESYNCH "DESYNCH"
! #define CMD_DIE "DIE"
! #define CMD_DNS "DNS"
! #define CMD_EOB "END_OF_BURST"
! #define CMD_EOB_ACK "EOB_ACK"
! #define CMD_ERROR "ERROR"
! #define CMD_GET "GET"
! #define CMD_GLINE "GLINE"
! #define CMD_HASH "HASH"
! #define CMD_HELP "HELP"
! #define CMD_INFO "INFO"
! #define CMD_INVITE "INVITE"
! #define CMD_ISON "ISON"
! #define CMD_JOIN "JOIN"
! #define CMD_JUPE "JUPE"
! #define CMD_KICK "KICK"
! #define CMD_KILL "KILL"
! #define CMD_LINKS "LINKS"
! #define CMD_LIST "LIST"
! #define CMD_LUSERS "LUSERS"
! #define CMD_MAP "MAP"
! #define CMD_MODE "MODE"
! #define CMD_MOTD "MOTD"
! #define CMD_NAMES "NAMES"
! #define CMD_NICK "NICK"
! #define CMD_NOTICE "NOTICE"
! #define CMD_OPER "OPER"
! #define CMD_OPMODE "OPMODE"
! #define CMD_PART "PART"
! #define CMD_PASS "PASS"
! #define CMD_PING "PING"
! #define CMD_PONG "PONG"
! #define CMD_POST "POST"
! #define CMD_PRIVMSG "PRIVMSG"
! #define CMD_PRIVS "PRIVS"
! #define CMD_PROTO "PROTO"
! #define CMD_QUIT "QUIT"
! #define CMD_REHASH "REHASH"
! #define CMD_RESET "RESET"
! #define CMD_RESTART "RESTART"
! #define CMD_RPING "RPING"
! #define CMD_RPONG "RPONG"
! #define CMD_SERVER "SERVER"
! #define CMD_SERVLIST "SERVLIST"
! #define CMD_SERVSET "SERVSET"
! #define CMD_SET "SET"
! #define CMD_SETTIME "SETTIME"
! #define CMD_SILENCE "SILENCE"
! #define CMD_SQUERY "SQUERY"
! #define CMD_SQUIT "SQUIT"
! #define CMD_STATS "STATS"
! #define CMD_TIME "TIME"
! #define CMD_TOPIC "TOPIC"
! #define CMD_TRACE "TRACE"
! #define CMD_UPING "UPING"
! #define CMD_USER "USER"
! #define CMD_USERHOST "USERHOST"
! #define CMD_USERIP "USERIP"
! #define CMD_VERSION "VERSION"
! #define CMD_WALLCHOPS "WALLCHOPS"
! #define CMD_WALLOPS "WALLOPS"
! #define CMD_WALLUSERS "WALLUSERS"
! #define CMD_WHO "WHO"
! #define CMD_WHOIS "WHOIS"
! #define CMD_WHOWAS "WHOWAS"
!
! /* Tokenized commands. */
! #define TOK_ACCOUNT "AC"
! #define TOK_ADMIN "AD"
! #define TOK_ASLL "LL"
! #define TOK_AWAY "A"
! #define TOK_BURST "B"
! #define TOK_CLEARMODE "CM"
! #define TOK_CLOSE "CLOSE"
! #define TOK_CNOTICE "CN"
! #define TOK_CONNECT "CO"
! #define TOK_CPRIVMSG "CP"
! #define TOK_CREATE "C"
! #define TOK_DESTRUCT "DE"
! #define TOK_DESYNCH "DS"
! #define TOK_DIE "DIE"
! #define TOK_DNS "DNS"
! #define TOK_EOB "EB"
! #define TOK_EOB_ACK "EA"
! #define TOK_ERROR "Y"
! #define TOK_GET "GET"
! #define TOK_GLINE "GL"
! #define TOK_HASH "HASH"
! #define TOK_HELP "HELP"
! #define TOK_INFO "F"
! #define TOK_INVITE "I"
! #define TOK_ISON "ISON"
! #define TOK_JOIN "J"
! #define TOK_JUPE "JU"
! #define TOK_KICK "K"
! #define TOK_KILL "D"
! #define TOK_LINKS "LI"
! #define TOK_LIST "LIST"
! #define TOK_LUSERS "LU"
! #define TOK_MAP "MAP"
! #define TOK_MODE "M"
! #define TOK_MOTD "MO"
! #define TOK_NAMES "E"
! #define TOK_NICK "N"
! #define TOK_NOTICE "O"
! #define TOK_OPER "OPER"
! #define TOK_OPMODE "OM"
! #define TOK_PART "L"
! #define TOK_PASS "PA"
! #define TOK_PING "G"
! #define TOK_PONG "Z"
! #define TOK_POST "POST"
! #define TOK_PRIVMSG "P"
! #define TOK_PRIVS "PRIVS"
! #define TOK_PROTO "PROTO"
! #define TOK_QUIT "Q"
! #define TOK_REHASH "REHASH"
! #define TOK_RESET "RESET"
! #define TOK_RESTART "RESTART"
! #define TOK_RPING "RI"
! #define TOK_RPONG "RO"
! #define TOK_SERVER "S"
! #define TOK_SERVLIST "SERVSET"
! #define TOK_SERVSET "SERVSET"
! #define TOK_SET "SET"
! #define TOK_SETTIME "SE"
! #define TOK_SILENCE "U"
! #define TOK_SQUERY "SQUERY"
! #define TOK_SQUIT "SQ"
! #define TOK_STATS "R"
! #define TOK_TIME "TI"
! #define TOK_TOPIC "T"
! #define TOK_TRACE "TR"
! #define TOK_UPING "UP"
! #define TOK_USER "USER"
! #define TOK_USERHOST "USERHOST"
! #define TOK_USERIP "USERIP"
! #define TOK_VERSION "V"
! #define TOK_WALLCHOPS "WC"
! #define TOK_WALLOPS "WA"
! #define TOK_WALLUSERS "WU"
! #define TOK_WHO "H"
! #define TOK_WHOIS "W"
! #define TOK_WHOWAS "X"
/* Servers claiming to have a boot or link time before PREHISTORY
***************
*** 247,255 ****
if (srv == self) {
/* The +s, ignored by Run's ircu, means "service" to Undernet's ircu */
! putsock("%s %s %d %li %li J10 %s%s +s :%s",
! CMD_SERVER, srv->name, srv->hops+1, srv->boot, srv->link, srv->numeric, extranum, srv->description);
} else {
! putsock("%s %s %s %d %li %li %c10 %s%s +s :%s",
! self->numeric, CMD_SERVER, srv->name, srv->hops+1, srv->boot, srv->link, (srv->self_burst ? 'J' : 'P'), srv->numeric, extranum, srv->description);
}
}
--- 436,444 ----
if (srv == self) {
/* The +s, ignored by Run's ircu, means "service" to Undernet's ircu */
! putsock(P10_SERVER " %s %d %li %li J10 %s%s +s :%s",
! srv->name, srv->hops+1, srv->boot, srv->link, srv->numeric, extranum, srv->description);
} else {
! putsock("%s " P10_SERVER " %s %d %li %li %c10 %s%s +s :%s",
! self->numeric, srv->name, srv->hops+1, srv->boot, srv->link, (srv->self_burst ? 'J' : 'P'), srv->numeric, extranum, srv->description);
}
}
***************
*** 275,283 ****
/* we don't need to put the + in modes because it's in the format string. */
! putsock("%s %s %s %d %li %s %s +%s %s %s :%s",
! user->uplink->numeric, CMD_NICK, user->nick, user->uplink->hops+1, user->timestamp, user->ident, user->hostname, modes, b64ip, user->numeric, user->info);
} else {
! putsock("%s %s %s %d %li %s %s %s %s :%s",
! user->uplink->numeric, CMD_NICK, user->nick, user->uplink->hops+1, user->timestamp, user->ident, user->hostname, b64ip, user->numeric, user->info);
}
}
--- 464,472 ----
/* we don't need to put the + in modes because it's in the format string. */
! putsock("%s " P10_NICK " %s %d %li %s %s +%s %s %s :%s",
! user->uplink->numeric, user->nick, user->uplink->hops+1, user->timestamp, user->ident, user->hostname, modes, b64ip, user->numeric, user->info);
} else {
! putsock("%s " P10_NICK " %s %d %li %s %s %s %s :%s",
! user->uplink->numeric, user->nick, user->uplink->hops+1, user->timestamp, user->ident, user->hostname, b64ip, user->numeric, user->info);
}
}
***************
*** 286,290 ****
irc_account(struct userNode *user, const char *stamp)
{
! putsock("%s %s %s %s", self->numeric, CMD_ACCOUNT, user->numeric, stamp);
}
--- 475,479 ----
irc_account(struct userNode *user, const char *stamp)
{
! putsock("%s " P10_ACCOUNT " %s %s", self->numeric, user->numeric, stamp);
}
***************
*** 292,296 ****
irc_nick(struct userNode *user, const char *new_nick)
{
! putsock("%s %s %s "FMT_TIME_T, user->numeric, CMD_NICK, new_nick, now);
}
--- 481,485 ----
irc_nick(struct userNode *user, const char *new_nick)
{
! putsock("%s " P10_NICK " %s "FMT_TIME_T, user->numeric, new_nick, now);
}
***************
*** 299,303 ****
{
if (!from || !to) return;
! putsock("%s %s %s", from->numeric, CMD_TOPIC, to);
}
--- 488,492 ----
{
if (!from || !to) return;
! putsock("%s " P10_TOPIC " %s", from->numeric, to);
}
***************
*** 318,322 ****
}
! putsock("%s %s %s %d :%s", self->numeric, CMD_SQUIT, srv->name, 0, message);
if (srv == self) {
--- 507,511 ----
}
! putsock("%s " P10_SQUIT " %s %d :%s", self->numeric, srv->name, 0, message);
if (srv == self) {
***************
*** 331,335 ****
irc_wallchops(struct userNode *from, const char *to, const char *message)
{
! putsock("%s %s %s :%s", from->numeric, CMD_WALLCHOPS, to, message);
}
--- 520,524 ----
irc_wallchops(struct userNode *from, const char *to, const char *message)
{
! putsock("%s " P10_WALLCHOPS " %s :%s", from->numeric, to, message);
}
***************
*** 337,341 ****
irc_notice(struct userNode *from, const char *to, const char *message)
{
! putsock("%s %s %s :%s", from->numeric, CMD_NOTICE, to, message);
}
--- 526,530 ----
irc_notice(struct userNode *from, const char *to, const char *message)
{
! putsock("%s " P10_NOTICE " %s :%s", from->numeric, to, message);
}
***************
*** 343,347 ****
irc_privmsg(struct userNode *from, const char *to, const char *message)
{
! putsock("%s %s %s :%s", from->numeric, CMD_PRIVMSG, to, message);
}
--- 532,536 ----
irc_privmsg(struct userNode *from, const char *to, const char *message)
{
! putsock("%s " P10_PRIVMSG " %s :%s", from->numeric, to, message);
}
***************
*** 349,353 ****
irc_eob(void)
{
! putsock("%s %s", self->numeric, CMD_EOB);
}
--- 538,542 ----
irc_eob(void)
{
! putsock("%s " P10_EOB, self->numeric);
}
***************
*** 355,365 ****
irc_eob_ack(void)
{
! putsock("%s %s", self->numeric, CMD_EOB_ACK);
}
void
! irc_ping(const char *something)
{
! putsock("%s %s :%s", self->numeric, CMD_PING, something);
}
--- 544,554 ----
irc_eob_ack(void)
{
! putsock("%s " P10_EOB_ACK, self->numeric);
}
void
! irc_ping(const char *payload)
{
! putsock("%s " P10_PING " :%s", self->numeric, payload);
}
***************
*** 367,371 ****
irc_pong(const char *who, const char *data)
{
! putsock("%s %s %s :%s", self->numeric, CMD_PONG, who, data);
}
--- 556,560 ----
irc_pong(const char *who, const char *data)
{
! putsock("%s " P10_PONG " %s :%s", self->numeric, who, data);
}
***************
*** 373,377 ****
irc_pass(const char *passwd)
{
! putsock("PASS :%s", passwd);
}
--- 562,566 ----
irc_pass(const char *passwd)
{
! putsock(P10_PASS " :%s", passwd);
}
***************
*** 393,397 ****
irc_gline(struct server *srv, struct gline *gline)
{
! putsock("%s %s %s +%s %ld :%s", self->numeric, CMD_GLINE, (srv ? srv->numeric : "*"), gline->target, gline->expires-now, gline->reason);
}
--- 582,587 ----
irc_gline(struct server *srv, struct gline *gline)
{
! putsock("%s " P10_GLINE " %s +%s %ld :%s",
! self->numeric, (srv ? srv->numeric : "*"), gline->target, gline->expires-now, gline->reason);
}
***************
*** 399,403 ****
irc_ungline(const char *mask)
{
! putsock("%s %s * -%s", self->numeric, CMD_GLINE, mask);
}
--- 589,593 ----
irc_ungline(const char *mask)
{
! putsock("%s " P10_GLINE " * -%s", self->numeric, mask);
}
***************
*** 436,440 ****
unsigned int n;
! base_len = sprintf(burst_line, "%s %s %s " FMT_TIME_T " ", self->numeric, CMD_BURST, chan->name, chan->timestamp);
len = irc_make_chanmode(chan, burst_line+base_len);
pos = base_len + len - 1;
--- 626,631 ----
unsigned int n;
! base_len = sprintf(burst_line, "%s " P10_BURST " %s " FMT_TIME_T " ",
! self->numeric, chan->name, chan->timestamp);
len = irc_make_chanmode(chan, burst_line+base_len);
pos = base_len + len - 1;
***************
*** 494,498 ****
irc_quit(struct userNode *user, const char *message)
{
! putsock("%s %s :%s", user->numeric, CMD_QUIT, message);
}
--- 685,689 ----
irc_quit(struct userNode *user, const char *message)
{
! putsock("%s " P10_QUIT " :%s", user->numeric, message);
}
***************
*** 501,507 ****
{
if (to) {
! putsock("%s %s :%s", to, CMD_ERROR, message);
} else {
! putsock(":%s %s :%s", self->name, CMD_ERROR, message);
}
}
--- 692,698 ----
{
if (to) {
! putsock("%s " P10_ERROR " :%s", to, message);
} else {
! putsock(":%s " P10_ERROR " :%s", self->name, message);
}
}
***************
*** 511,517 ****
{
if (from) {
! putsock("%s %s %s :%s!%s (%s)", from->numeric, CMD_KILL, target->numeric, self->name, from->nick, message);
} else {
! putsock("%s %s %s :%s (%s)", self->numeric, CMD_KILL, target->numeric, self->name, message);
}
}
--- 702,710 ----
{
if (from) {
! putsock("%s " P10_KILL " %s :%s!%s (%s)",
! from->numeric, target->numeric, self->name, from->nick, message);
} else {
! putsock("%s " P10_KILL " %s :%s (%s)",
! self->numeric, target->numeric, self->name, message);
}
}
***************
*** 527,531 ****
numeric = self->numeric;
}
! putsock("%s %s %s %s "FMT_TIME_T, numeric, CMD_MODE, target->name, modes, target->timestamp);
}
--- 720,725 ----
numeric = self->numeric;
}
! putsock("%s " P10_MODE " %s %s "FMT_TIME_T,
! numeric, target->name, modes, target->timestamp);
}
***************
*** 533,537 ****
irc_invite(struct userNode *from, struct userNode *who, struct chanNode *to)
{
! putsock("%s %s %s %s", from->numeric, CMD_INVITE, who->nick, to->name);
}
--- 727,731 ----
irc_invite(struct userNode *from, struct userNode *who, struct chanNode *to)
{
! putsock("%s " P10_INVITE " %s %s", from->numeric, who->nick, to->name);
}
***************
*** 540,546 ****
{
if (what->members.used == 1) {
! putsock("%s %s %s %lu", who->numeric, CMD_CREATE, what->name, what->timestamp);
} else {
! putsock("%s %s %s", who->numeric, CMD_JOIN, what->name);
}
}
--- 734,741 ----
{
if (what->members.used == 1) {
! putsock("%s " P10_CREATE " %s %lu",
! who->numeric, what->name, what->timestamp);
} else {
! putsock("%s " P10_JOIN " %s", who->numeric, what->name);
}
}
***************
*** 552,556 ****
struct modeNode *mn = GetUserMode(channel, who);
numeric = (mn && (mn->modes & MODE_CHANOP)) ? who->numeric : self->numeric;
! putsock("%s %s %s %s :%s", numeric, CMD_KICK, channel->name, target->numeric, msg);
}
--- 747,752 ----
struct modeNode *mn = GetUserMode(channel, who);
numeric = (mn && (mn->modes & MODE_CHANOP)) ? who->numeric : self->numeric;
! putsock("%s " P10_KICK " %s %s :%s",
! numeric, channel->name, target->numeric, msg);
}
***************
*** 558,562 ****
irc_stats(struct userNode *from, struct server *target, char type)
{
! putsock("%s %s %c :%s", from->numeric, CMD_STATS, type, target->numeric);
}
--- 754,758 ----
irc_stats(struct userNode *from, struct server *target, char type)
{
! putsock("%s " P10_STATS " %c :%s", from->numeric, type, target->numeric);
}
***************
*** 565,571 ****
{
if (reason) {
! putsock("%s %s %s :%s", who->numeric, CMD_PART, what->name, reason);
} else {
! putsock("%s %s %s", who->numeric, CMD_PART, what->name);
}
}
--- 761,767 ----
{
if (reason) {
! putsock("%s " P10_PART " %s :%s", who->numeric, what->name, reason);
} else {
! putsock("%s " P10_PART " %s", who->numeric, what->name);
}
}
***************
*** 574,578 ****
irc_topic(struct userNode *who, struct chanNode *what, const char *topic)
{
! putsock("%s %s %s :%s", who->numeric, CMD_TOPIC, what->name, topic);
}
--- 770,774 ----
irc_topic(struct userNode *who, struct chanNode *what, const char *topic)
{
! putsock("%s " P10_TOPIC " %s :%s", who->numeric, what->name, topic);
}
|