Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv18278/src
Modified Files:
proto-bahamut.c proto-p10.c proto.h
Log Message:
add SVSNICK protocol support
Index: proto-bahamut.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-bahamut.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -r1.21 -r1.22
*** proto-bahamut.c 23 Aug 2002 04:49:39 -0000 1.21
--- proto-bahamut.c 8 Sep 2002 04:32:11 -0000 1.22
***************
*** 448,451 ****
--- 448,457 ----
void
+ irc_svsnick(struct userNode *from, struct userNode *target, const char *newnick)
+ {
+ putsock(":%s " P10_SVSNICK " %s %s :"FMT_TIME_T, from->nick, target->nick, newnick, now);
+ }
+
+ void
irc_numeric(struct userNode *user, unsigned int num, const char *format, ...) {
va_list arg_list;
***************
*** 882,885 ****
--- 888,903 ----
}
+ static CMD_FUNC(cmd_svsnick)
+ {
+ struct userNode *target, *dest;
+ (void)origin;
+ if (argc < 4) return 0;
+ if (!(target = GetUserH(argv[1]))) return 0;
+ if (!IsLocal(target)) return 0;
+ if ((dest = GetUserH(argv[2]))) return 0; /* Note: Bahamut will /KILL instead. */
+ NickChange(target, argv[2], 0);
+ return 1;
+ }
+
static oper_func_t *of_list;
static unsigned int of_size = 0, of_used = 0;
***************
*** 935,938 ****
--- 953,957 ----
dict_insert(irc_func_dict, "SQUIT", cmd_squit);
dict_insert(irc_func_dict, "STATS", cmd_stats);
+ dict_insert(irc_func_dict, "SVSNICK", cmd_svsnick);
dict_insert(irc_func_dict, "SVINFO", cmd_svinfo);
dict_insert(irc_func_dict, "TOPIC", cmd_topic);
Index: proto-p10.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-p10.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -r1.29 -r1.30
*** proto-p10.c 5 Sep 2002 14:57:22 -0000 1.29
--- proto-p10.c 8 Sep 2002 04:32:12 -0000 1.30
***************
*** 85,88 ****
--- 85,89 ----
#define CMD_SQUIT "SQUIT"
#define CMD_STATS "STATS"
+ #define CMD_SVSNICK "SVSNICK"
#define CMD_TIME "TIME"
#define CMD_TOPIC "TOPIC"
***************
*** 164,167 ****
--- 165,169 ----
#define TOK_SQUIT "SQ"
#define TOK_STATS "R"
+ #define TOK_SVSNICK "SN"
#define TOK_TIME "TI"
#define TOK_TOPIC "T"
***************
*** 254,257 ****
--- 256,260 ----
#define P10_SQUIT TYPE(SQUIT)
#define P10_STATS TYPE(STATS)
+ #define P10_SVSNICK TYPE(SVSNICK)
#define P10_TIME TYPE(TIME)
#define P10_TOPIC TYPE(TOPIC)
***************
*** 668,671 ****
--- 671,680 ----
void
+ irc_svsnick(struct userNode *from, struct userNode *target, const char *newnick)
+ {
+ putsock("%s " P10_SVSNICK " %s %s "FMT_TIME_T, from->uplink->numeric, target->numeric, newnick, now);
+ }
+
+ void
irc_part(struct userNode *who, struct chanNode *what, const char *reason)
{
***************
*** 1276,1279 ****
--- 1285,1300 ----
}
+ static CMD_FUNC(cmd_svsnick)
+ {
+ struct userNode *target, *dest;
+ (void)origin;
+ if (argc < 4) return 0;
+ if (!(target = GetUserN(argv[1]))) return 0;
+ if (!IsLocal(target)) return 0;
+ if ((dest = GetUserH(argv[2]))) return 0; /* Note: Bahamut will /KILL instead. */
+ NickChange(target, argv[2], 0);
+ return 1;
+ }
+
static oper_func_t *of_list;
static unsigned int of_size = 0, of_used = 0;
***************
*** 1379,1382 ****
--- 1400,1405 ----
dict_insert(irc_func_dict, CMD_STATS, cmd_stats);
dict_insert(irc_func_dict, TOK_STATS, cmd_stats);
+ dict_insert(irc_func_dict, CMD_SVSNICK, cmd_svsnick);
+ dict_insert(irc_func_dict, TOK_SVSNICK, cmd_svsnick);
dict_insert(irc_func_dict, CMD_WHOIS, cmd_whois);
dict_insert(irc_func_dict, TOK_WHOIS, cmd_whois);
Index: proto.h
===================================================================
RCS file: /cvsroot/srvx/services/src/proto.h,v
retrieving revision 1.64
retrieving revision 1.65
diff -C2 -r1.64 -r1.65
*** proto.h 14 Aug 2002 21:55:49 -0000 1.64
--- proto.h 8 Sep 2002 04:32:12 -0000 1.65
***************
*** 149,152 ****
--- 149,153 ----
void irc_raw(const char *what);
void irc_stats(struct userNode *from, struct server *target, char type);
+ void irc_svsnick(struct userNode *from, struct userNode *target, const char *newnick);
/* account maintenance */
|