Allow *account to be used in !say and !emote.
authorThiefMaster <thiefmaster@gamesurge.net>
Tue, 12 Feb 2008 14:26:06 +0000 (15:26 +0100)
committerMichael Poole <mdpoole@troilus.org>
Sun, 9 Mar 2008 00:37:49 +0000 (19:37 -0500)
src/chanserv.c
src/chanserv.help

index 9ad4cd40ca496bd48bcdbd45e9683293a1eeb78d..aa86929eeed55bb104f7e6ad64ee8aa46799ba5b 100644 (file)
@@ -4841,6 +4841,23 @@ static CHANSERV_FUNC(cmd_say)
         msg = unsplit_string(argv + 1, argc - 1, NULL);
         send_channel_message(channel, cmd->parent->bot, "%s", msg);
     }
+    else if(*argv[1] == '*' && argv[1][1] != '\0')
+    {
+        struct handle_info *hi;
+        struct userNode *authed;
+
+        REQUIRE_PARAMS(3);
+        msg = unsplit_string(argv + 2, argc - 2, NULL);
+
+        if (!(hi = get_handle_info(argv[1] + 1)))
+        {
+            reply("MSG_HANDLE_UNKNOWN", argv[1] + 1);
+            return 0;
+        }
+
+        for (authed = hi->users; authed; authed = authed->next_authed)
+            send_target_message(5, authed->nick, cmd->parent->bot, "%s", msg);
+    }
     else if(GetUserH(argv[1]))
     {
         REQUIRE_PARAMS(3);
@@ -4865,6 +4882,23 @@ static CHANSERV_FUNC(cmd_emote)
         msg = unsplit_string(argv + 1, argc - 1, NULL);
         send_channel_message(channel, cmd->parent->bot, "\001ACTION %s\001", msg);
     }
+    else if(*argv[1] == '*' && argv[1][1] != '\0')
+    {
+        struct handle_info *hi;
+        struct userNode *authed;
+
+        REQUIRE_PARAMS(3);
+        msg = unsplit_string(argv + 2, argc - 2, NULL);
+
+        if (!(hi = get_handle_info(argv[1] + 1)))
+        {
+            reply("MSG_HANDLE_UNKNOWN", argv[1] + 1);
+            return 0;
+        }
+
+        for (authed = hi->users; authed; authed = authed->next_authed)
+            send_target_message(5, authed->nick, cmd->parent->bot, "\001ACTION %s\001", msg);
+    }
     else if(GetUserH(argv[1]))
     {
         msg = unsplit_string(argv + 2, argc - 2, NULL);
index 87bc3f7d7cad33042ae30f7f1d916f99a6f06559..0746f191d9a367fd94222db1ffaf9d726e760029 100644 (file)
         "The valid duration letters are $by$b (for year, or 365 days), $bM$b (for month, or 31 days), $bw$b (for week, or 7 days), $bd$b (for day, or 24 hours), $bh$b (for hour, or 60 minutes), $bm$b (for minute, or 60 seconds), and $bs$b (for second).  We know not all years are 365 days and not all months are 31 days, but we pretend they are for parsing durations.",
         "If the last duration part does not have any letter to indicate the units, seconds are assumed.",
         "$uExamples$u: 1y1M is 365 days plus 31 days; 1y1m is 365 days plus 1 minute; 1h30m45 is ninety minutes and forty-five seconds; and so forth.");
-"EMOTE" ("/msg $C EMOTE <#channel> <text>",
-        "Makes $b$C$b send a CTCP ACTION message to the specified channel.",
+"EMOTE" ("/msg $C EMOTE <#channel|nick|*account> <text>",
+        "Makes $b$C$b send a CTCP ACTION message to the specified channel/nick or all users on the account.",
         "$uSee Also:$u say");
 "EVENTS" ("/msg $C EVENTS <#channel> [limit [pattern]]",
         "Allows channel coowners to view a list of events related to their channel. If a pattern is provided, only events with a matching description will be displayed.",
         "$uSee Also:$u createnote");
 "RESYNC" ("/msg $S RESYNC <#channel>",
         "Synchronizes users in the channel with the userlist.  This means that if the user can normally get ops, $S makes sure the user has ops.  Otherwise, if the user normally gets voice, $S makes sure the user has voice but not ops.  Otherwise, $S makes sure the user has neither voice nor ops.");
-"SAY" ("/msg $C SAY <#channel> <text>",
-        "Makes $b$C$b send a message to the specified channel.",
+"SAY" ("/msg $C SAY <#channel|nick|*account> <text>",
+        "Makes $b$C$b send a message to the specified channel/nick or all users on the account.",
         "$uSee Also:$u emote");
 "SEARCH CRITERIA" ("$bSEARCH CRITERIA$b",
         "The following criteria may be used:",