X-Git-Url: https://jfr.im/git/irc/quakenet/newserv.git/blobdiff_plain/fc62081995278b68fa8a161b2807c75d1b2c77ac..7e032dc63479ed3d0b76fe71c05303fbe7dbc53a:/localuser/localuserchannel.c diff --git a/localuser/localuserchannel.c b/localuser/localuserchannel.c index bacb55b4..d770f877 100644 --- a/localuser/localuserchannel.c +++ b/localuser/localuserchannel.c @@ -12,6 +12,7 @@ #include #include #include +#include MODULE_VERSION(""); @@ -94,7 +95,7 @@ int handleinvitecmd(void *source, int cargc, char **cargv) { } if (!(sender=getnickbynumericstr(source))) { - Error("localuserchannel",ERR_WARNING,"Got invite from unknown numeric %s.",source); + Error("localuserchannel",ERR_WARNING,"Got invite from unknown numeric %s.",(char *)source); return CMD_OK; } @@ -352,7 +353,7 @@ int localpartchannel(nick *np, channel *cp, char *reason) { /* Check pointers are valid.. */ if (cp==NULL || np==NULL) { - Error("localuserchannel",ERR_WARNING,"Trying to part NULL channel or NULL nick (cp=%x,np=%x)",cp,np); + Error("localuserchannel",ERR_WARNING,"Trying to part NULL channel or NULL nick (cp=%p,np=%p)",cp,np); return 1; } @@ -708,6 +709,11 @@ void localdosetmode_nick (modechanges *changes, nick *target, short modes) { return; } + if (IsCloaked(target)) { + /* Target is cloaked, never set channel modes for cloaked users */ + return; + } + if ((modes & MC_DEOP) && (*lp & CUMODE_OP)) { (*lp) &= ~CUMODE_OP; if (changes->changecount >= MAXMODEARGS) @@ -909,15 +915,15 @@ void localsettopic(nick *np, channel *cp, char *topic) { cp->topic=getsstring(topic,TOPICLEN); - /* Guarantee that the topic timestamp is greater than the old one. */ - if (cp->topictime >= now) { - cp->topictime++; - } else { - cp->topictime=getnettime(); + /* Update the topic time iff the old time was in the past. This + * means if we are bouncing a topic with a TS 1sec newer than ours + * we won't use an old timestamp */ + if (cp->topictime < now) { + cp->topictime=now; } if (connected) { - irc_send("%s T %s %u %u :%s",source,cp->index->name->content,cp->timestamp,cp->topictime,(cp->topic)?cp->topic->content:""); + irc_send("%s T %s %jd %jd :%s",source,cp->index->name->content,(intmax_t)cp->timestamp,(intmax_t)cp->topictime,(cp->topic)?cp->topic->content:""); } } @@ -1065,7 +1071,7 @@ void sendopnoticetochannel(nick *source, channel *cp, char *format, ... ) { } } -void localinvite(nick *source, channel *cp, nick *target) { +void localinvite(nick *source, chanindex *cip, nick *target) { /* Servers can't send invites */ if (!source) @@ -1077,7 +1083,7 @@ void localinvite(nick *source, channel *cp, nick *target) { * argument */ if (connected) { irc_send("%s I %s :%s",longtonumeric(source->numeric,5), - target->nick, cp->index->name->content); + target->nick, cip->name->content); } }