Display rather than clear the channel topic on /topic without params
authorManuel Nickschas <sputnick@quassel-irc.org>
Sat, 15 Nov 2008 20:51:37 +0000 (21:51 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sat, 15 Nov 2008 20:51:37 +0000 (21:51 +0100)
This has been discussed in BR #113 as well as #BR 289. User feedback has shown that
this is the expected behavior, moreover users have complained about accidentally clearing
the topic.
This requires a core restart.

src/core/userinputhandler.cpp

index fcb879e..5315768 100644 (file)
@@ -343,13 +343,11 @@ void UserInputHandler::handleSay(const BufferInfo &bufferInfo, const QString &ms
 
 void UserInputHandler::handleTopic(const BufferInfo &bufferInfo, const QString &msg) {
   if(bufferInfo.bufferName().isEmpty()) return;
-  if(!msg.isEmpty()) {
-    QList<QByteArray> params;
-    params << serverEncode(bufferInfo.bufferName()) << channelEncode(bufferInfo.bufferName(), msg);
-    emit putCmd("TOPIC", params);
-  } else {
-    emit networkConnection()->putRawLine("TOPIC " + serverEncode(bufferInfo.bufferName()) + " :");
-  }
+  QList<QByteArray> params;
+  params << serverEncode(bufferInfo.bufferName());
+  if(!msg.isEmpty())
+    params << channelEncode(bufferInfo.bufferName(), msg);
+  emit putCmd("TOPIC", params);
 }
 
 void UserInputHandler::handleVoice(const BufferInfo &bufferInfo, const QString &msg) {