Bug 238203 - amsg to only one server
Summary: amsg to only one server
Status: RESOLVED FIXED
Alias: None
Product: konversation
Classification: Applications
Component: inputline (show other bugs)
Version: unspecified
Platform: Unlisted Binaries Linux
: NOR wishlist
Target Milestone: ---
Assignee: Konversation Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-19 17:54 UTC by boesmans
Modified: 2010-05-20 00:31 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description boesmans 2010-05-19 17:54:13 UTC
Hi,

I would like a way to be able to send an amsg only to the current server I am on at the moment.

So state i'm on server X,Y and Z and I amsg in channel #x that is located on server X, I don't want my message to go to server Y or Z.
It's annoying for people on other servers that have no message with what I'm typing elsewhere (online game)

Thanks in advance.
Ites
Comment 1 Eike Hein 2010-05-20 00:31:28 UTC
commit f8e391a0b333b188ff8b8c934b256c5cdff108f8
Author: Eike Hein <hein@kde.org>
Date:   Thu May 20 00:27:50 2010 +0200

    Add a -local parameter to the /amsg and /ame commands.
    
    The parameter limits its scope to channel and query tabs associated
    with the same connection as the tab the command is issued in.
    
    BUG:238203

diff --git a/ChangeLog b/ChangeLog
index 04fd09b..2907aa0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -120,6 +120,9 @@ Changes since 1.2.3:
 * Added an action to switch to the last focused tab, making it possi-
   ble to quickly switch forth and back between two tabs. The default
   keyboard shortcut for this new action is Alt+Space.
+* Added a "-local" parameter to the '/amsg' and '/ame' commands that
+  limits its scope to the channel and query tabs associated with the
+  same connection as the tab the command is issued in.
 
 
 Changes from 1.2.2 to 1.2.3:
diff --git a/src/irc/outputfilter.cpp b/src/irc/outputfilter.cpp
index f693dc2..1302c24 100644
--- a/src/irc/outputfilter.cpp
+++ b/src/irc/outputfilter.cpp
@@ -836,9 +836,12 @@ namespace Konversation
     OutputFilterResult OutputFilter::command_ame(const OutputFilterInput& input)
     {
         if (input.parameter.isEmpty())
-            return usage(i18n("Usage: %1AME text", Preferences::self()->commandChar()));
+            return usage(i18n("Usage: %1AME [-LOCAL] text", Preferences::self()->commandChar()));
 
-        emit multiServerCommand("me", input.parameter);
+        if (input.parameter.section(' ', 0, 0).toLower() == "-local")
+            m_server->sendToAllChannelsAndQueries(Preferences::self()->commandChar() + "me " + input.parameter.section(' ', 1));
+        else
+            emit multiServerCommand("me", input.parameter);
 
         return OutputFilterResult();
     }
@@ -846,9 +849,12 @@ namespace Konversation
     OutputFilterResult OutputFilter::command_amsg(const OutputFilterInput& input)
     {
         if (input.parameter.isEmpty())
-            return usage(i18n("Usage: %1AMSG text", Preferences::self()->commandChar()));
+            return usage(i18n("Usage: %1AMSG [-LOCAL] text", Preferences::self()->commandChar()));
 
-        emit multiServerCommand("msg", input.parameter);
+        if (input.parameter.section(' ', 0, 0).toLower() == "-local")
+            m_server->sendToAllChannelsAndQueries(input.parameter.section(' ', 1));
+        else
+            emit multiServerCommand("msg", input.parameter);
 
         return OutputFilterResult();
     }
diff --git a/src/irc/server.h b/src/irc/server.h
index 2c75897..370c783 100644
--- a/src/irc/server.h
+++ b/src/irc/server.h
@@ -482,6 +482,7 @@ void resetNickSelection();
         void disconnectServer();
         void showSSLDialog();
         void sendToAllChannels(const QString& text);
+        void sendToAllChannelsAndQueries(const QString& text);
         void notifyTimeout();
 
         void enableIdentifyMsg(bool enabled);
@@ -552,7 +553,6 @@ void resetNickSelection();
         void setTopicAuthor(const QString& channel,const QString& author, QDateTime t);
         void endOfWho(const QString& target);
         void invitation(const QString& nick,const QString& channel);
-        void sendToAllChannelsAndQueries(const QString& text);
         void gotOwnResolvedHostByWelcome(const QHostInfo& res);
         void gotOwnResolvedHostByUserhost(const QHostInfo& res);