]> jfr.im git - irc/quakenet/newserv.git/commitdiff
LOCALUSER: Changed "localinvite" to take a chanindex * to identify the
authorsplidge <redacted>
Mon, 8 Mar 2010 11:05:09 +0000 (11:05 +0000)
committersplidge <redacted>
Mon, 8 Mar 2010 11:05:09 +0000 (11:05 +0000)
channel rather than a channel *.  This allows inviting to empty channels.

Updated all users of this function accordingly (chanserv, helpmod2, lua).

chanserv/chancmds/invite.c
chanserv/chanservuser.c
helpmod2/helpmod2.c
localuser/localuserchannel.c
localuser/localuserchannel.h
lua/luacommands.c

index 3b9f71982fc1365edd2362609f5ce6df6c6bf12c..69ee2eb0221e7066b27a31cf63e124733adf364e 100644 (file)
@@ -55,7 +55,7 @@ int csc_doinvite(void *source, int cargc, char **cargv) {
         continue;
       }
       
-      localinvite(chanservnick, rcup->chan->index->channel, sender);
+      localinvite(chanservnick, rcup->chan->index, sender);
     }
     
     chanservstdmessage(sender, QM_DONE);
@@ -67,7 +67,7 @@ int csc_doinvite(void *source, int cargc, char **cargv) {
     return CMD_ERROR;
 
   if (cip->channel) {
-    localinvite(chanservnick, cip->channel, sender);
+    localinvite(chanservnick, cip, sender);
   }
   chanservstdmessage(sender, QM_DONE);
  
index 8e6a2ef59e14f593267b40a665a03bbdd21dca75..039ec5627751338862e8ce1e6baf775c2c794575 100644 (file)
@@ -812,7 +812,7 @@ void cs_doallautomodes(nick *np) {
       } else {
        /* Channel exists but user is not joined: invite if they are +j-b */
        if (CUIsAutoInvite(rcup) && CUKnown(rcup) && !CUIsBanned(rcup)) {
-         localinvite(chanservnick, rcup->chan->index->channel, np);
+         localinvite(chanservnick, rcup->chan->index, np);
        }
       }
     }
index d625833942766e4d181507e1e1400f4ace75cbbe..c36af709104ba23bce6778598098b4c43e1dd634 100644 (file)
@@ -185,7 +185,7 @@ void helpmod_invite(hchannel *hchan, huser *husr)
     if (hchan->flags & H_PASSIVE)
         return;
 
-    localinvite(helpmodnick, hchan->real_channel, husr->real_user);
+    localinvite(helpmodnick, hchan->real_channel->index, husr->real_user);
 }
 
 static void hmode_set_channel(hchannel  *hchan)
index 86f4ed11e2b388c1fca80f5bd2e30dd11169d988..67d0b1b629331d37790f7c073cd933a936481bed 100644 (file)
@@ -1066,7 +1066,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) 
@@ -1078,7 +1078,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);
   }
 }
   
index 5f450ee9975141d3c1a5081931478e7f365e9805..14d534373e1711a4981b35aeb553bf4d431084c7 100644 (file)
@@ -41,7 +41,7 @@ void localkickuser(nick *np, channel *cp, nick *target, const char *message);
 void localusermodechange(nick *np, channel *cp, char *modes);
 void sendmessagetochannel(nick *source, channel *cp, char *format, ... ) __attribute__ ((format (printf, 3, 4)));
 void sendopnoticetochannel(nick *source, channel *cp, char *format, ... ) __attribute__ ((format (printf, 3, 4)));
-void localinvite(nick *source, channel *cp, nick *target);
+void localinvite(nick *source, chanindex *cip, nick *target);
 
 void localsetmodeinit (modechanges *changes, channel *cp, nick *np);
 void localdosetmode_nick (modechanges *changes, nick *target, short modes);
index 84b6e960e14c33162338e6d3817108a8fca1ed8f..22b1b45756318ed301d40624748b1daf8b0b503b 100644 (file)
@@ -210,7 +210,7 @@ static int lua_invite(lua_State *ps) {
   if(!cp)
     LUA_RETURN(ps, LUA_FAIL);
 
-  localinvite(lua_nick, cp, np);
+  localinvite(lua_nick, cp->index, np);
 
   LUA_RETURN(ps, LUA_OK);
 }