1

When connected to a Jabber server, a chat room starts without having any topic. I can set a topic by double-clicking on the headline or using the /topic command.

My question, however, is this: How can I delete/reset/clear the topic, to return to the initial clear state?

MPi
  • 2,071
  • 3
  • 21
  • 32
  • I assume that the answer is not strictly tied to pidgin, but to the jabber chatroom functionality, which interprets the /-commands (I think) – Patrick Cornelissen May 31 '19 at 14:29
  • Possibly – however `/topic` with no argument prints the topic, and the Pidgin parser has no concept of quotes or null strings, I believe. – MPi May 31 '19 at 14:49

1 Answers1

1

I have only found a very roundabout way to do this using qdbus. But since nobody has responded with an easier method yet, I'll share it:

qdbus --literal im.pidgin.purple.PurpleService \
  /im/pidgin/purple/PurpleObject im.pidgin.purple.PurpleInterface.PurpleGetChats
[Argument: ai {22651}]
qdbus im.pidgin.purple.PurpleService /im/pidgin/purple/PurpleObject \
  im.pidgin.purple.PurpleInterface.PurpleConversationGetChatData 22651
22652
qdbus im.pidgin.purple.PurpleService /im/pidgin/purple/PurpleObject \
  im.pidgin.purple.PurpleInterface.PurpleConvChatSetTopic 22652 someuser ""

This first queries the available chats. For each returned number, get the chat data id. Then finally set the topic using that chat data id.

Since I only had one chat, there could be no mistake of which chat id to pick. If you have more, you can check the current topic of each chat before changing it using the chat data id:

qdbus im.pidgin.purple.PurpleService /im/pidgin/purple/PurpleObject \
  im.pidgin.purple.PurpleInterface.PurpleConvChatGetTopic 22652
Schelte Bron
  • 111
  • 1
  • That looks quite good – however, I cannot confirm this as of today, since we stopped using Jabber. – MPi Sep 09 '20 at 13:12
  • Unfortunately, it only looks good. But it turns out that this just clears the topic locally for the user. It doesn't clear it on the server. So other users observe no change. And after disconnecting and reconnecting, the old topic is back. – Schelte Bron Oct 13 '20 at 22:09