From 7f6e904e0c4997a20aca704cfa6908d245f6ed40 Mon Sep 17 00:00:00 2001 From: ThiefMaster Date: Tue, 12 Feb 2008 15:26:06 +0100 Subject: [PATCH] Allow *account to be used in !say and !emote. --- src/chanserv.c | 34 ++++++++++++++++++++++++++++++++++ src/chanserv.help | 8 ++++---- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/src/chanserv.c b/src/chanserv.c index 9ad4cd4..aa86929 100644 --- a/src/chanserv.c +++ b/src/chanserv.c @@ -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); diff --git a/src/chanserv.help b/src/chanserv.help index 87bc3f7..0746f19 100644 --- a/src/chanserv.help +++ b/src/chanserv.help @@ -215,8 +215,8 @@ "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> ", - "Makes $b$C$b send a CTCP ACTION message to the specified channel.", +"EMOTE" ("/msg $C EMOTE <#channel|nick|*account> ", + "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.", @@ -312,8 +312,8 @@ "$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> ", - "Makes $b$C$b send a message to the specified channel.", +"SAY" ("/msg $C SAY <#channel|nick|*account> ", + "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:", -- 2.20.1