[Konversation-devel] [Bug 133240] expando nick variable for use in server commands (e.g., "/mode %n +x")
Eike Hein
sho at eikehein.com
Wed Aug 30 15:49:41 CEST 2006
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=133240
sho eikehein com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
------- Additional Comments From sho eikehein com 2006-08-30 15:49 -------
SVN commit 578875 by hein:
* Support %nick as a placeholder for the current nick in
the auto-connect commands.
BUG:133240
* Don't balk on leading whitespace in the auto-connect
commands. I assume I'm not the only one who by reflex
puts a space after the separating ";".
M +2 -0 ChangeLog
M +1 -1 src/commit.h
M +7 -2 src/server.cpp
--- trunk/extragear/network/konversation/ChangeLog #578874:578875
@ -185,6 +185,8 @
* If given no parameter, the "/away" command will now set the away state with
the default away message. The "/back" and "/unaway" commands can be used to
unset the away state.
+* You may now use "%nick" as a placeholder for your own nickname in the auto-
+ connect commands for a network.
* A bug that could lead to the auto-connect commands for a network not being
executed correctly has been fixed.
--- trunk/extragear/network/konversation/src/commit.h #578874:578875
@ -1,4 +1,4 @
// This COMMIT number is added to version string to be used as "patch level"
#ifndef COMMIT
-#define COMMIT 3156
+#define COMMIT 3157
#endif
--- trunk/extragear/network/konversation/src/server.cpp #578874:578875
@ -961,13 +961,18 @
{
if (!m_serverGroup->connectCommands().isEmpty())
{
- QStringList connectCommands = QStringList::split(";", m_serverGroup->connectCommands());
+ QString connectCommands = m_serverGroup->connectCommands();
+ if (!getNickname().isEmpty())
+ connectCommands.replace("%nick", getNickname());
+
+ QStringList connectCommandsList = QStringList::split(";", connectCommands);
QStringList::iterator iter;
- for(iter = connectCommands.begin(); iter != connectCommands.end(); ++iter)
+ for(iter = connectCommandsList.begin(); iter != connectCommandsList.end(); ++iter)
{
QString output(*iter);
+ output = output.simplifyWhiteSpace();
Konversation::OutputFilterResult result = outputFilter->parse(getNickname(),output,QString::null);
queue(result.toServer);
}
More information about the Konversation-devel
mailing list