]> jfr.im git - irc/evilnet/x3.git/blobdiff - src/chanserv.c
Fix some stuff with adduser pending
[irc/evilnet/x3.git] / src / chanserv.c
index c427ad4f930db497b741cedd4ea6e009d556f417..f7f7b03a70aaa90182dff9cf66478b20b51bcf46 100644 (file)
@@ -195,9 +195,11 @@ static const struct message_entry msgtab[] = {
     { "CSMSG_TRIMMED_USERS", "Trimmed $b%d users$b with access from %d to %d from the %s user list who were inactive for at least %s." },
     { "CSMSG_INCORRECT_ACCESS", "%s has access $b%s$b, not %s." },
     { "CSMSG_USER_EXISTS", "%s is already on the $b%s$b user list (with %s access)." },
-    { "CSMSG_ADDUSER_PENDING", "I have sent him/her a message letting them know, and if they auth or register soon, i will finish adding them automatically." },
+    { "CSMSG_ADDUSER_PENDING", "I have sent him/her a message letting them know, and if they auth or register soon, I will finish adding them automatically." },
     { "CSMSG_ADDUSER_PENDING_ALREADY", "He or she is already pending addition to %s once he/she auths with $b$N$b." },
-    { "CSMSG_ADDUSER_PENDING_LIST", "Channel %s user %s" }, /* Remove after testing */
+    { "CSMSG_ADDUSER_PENDING_HEADER", "Users to add to channels pending logins:" }, /* Remove after testing? */
+    { "CSMSG_ADDUSER_PENDING_LIST", "Channel %s user %s" },             /* Remove after testing? */
+    { "CSMSG_ADDUSER_PENDING_HEADER", "--------- End of pending list ----------" }, /* Remove after testing? */
     /*{ "CSMSG_ADDUSER_PENDING_NOTINCHAN", "That user is not in %s, and is not auth'd." }, */
     { "CSMSG_ADDUSER_PENDING_TARGET", "Channel Services bot here, %s would like to add you to my userlist in channel %s, but you are not auth'd to $b$N$b. Please auth now, and you will be added. If you do not have an accont, type /msg $N help register" },
     { "CSMSG_CANNOT_TRIM", "You must include a minimum inactivity duration of at least 60 seconds to trim." },
@@ -1309,8 +1311,15 @@ process_adduser_pending(struct userNode *user)
     while((ap = find_adduser_pending(NULL, user)))
     {
         struct userData *actee;
-        actee = add_channel_user(ap->channel->channel_info, ap->user->handle_info, ap->level, 0, NULL);
-        scan_user_presence(actee, NULL);
+        if(GetTrueChannelAccess(ap->channel->channel_info, ap->user->handle_info))
+        {
+            /* Already on the userlist. do nothing*/
+        }
+        else
+        {
+            actee = add_channel_user(ap->channel->channel_info, ap->user->handle_info, ap->level, 0, NULL);
+            scan_user_presence(actee, NULL);
+        }
         del_adduser_pending(ap);
     }
 }
@@ -3818,11 +3827,16 @@ cmd_list_users(struct userNode *user, struct chanNode *channel, unsigned int arg
     return 1;
 }
 
+/* Remove this now that debugging is over? or improve it for
+ * users? Would it be better tied into USERS somehow? -Rubin */
 static CHANSERV_FUNC(cmd_pending)
 {
     struct adduserPending *ap;
+    reply("CSMSG_ADDUSER_PENDING_HEADER");
+    reply("CSMSG_BAR");
     for(ap = adduser_pendings;ap;ap = ap->next)
         reply("CSMSG_ADDUSER_PENDING_LIST", ap->channel->name, ap->user->nick);
+    reply("CSMSG_ADDUSER_PENDING_FOOTER");
     return 1;
 }
 
@@ -7628,8 +7642,6 @@ init_chanserv(const char *nick)
     dict_set_free_data(plain_dnrs, free);
     mask_dnrs = dict_new();
     dict_set_free_data(mask_dnrs, free);
-    //TODO
-    //adduser_pending
 
     reg_svccmd_unbind_func(handle_svccmd_unbind);
     chanserv_module = module_register("ChanServ", CS_LOG, "chanserv.help", chanserv_expand_variable);