the-kenny / weechat.el

Chat via weechat's relay protocol in Emacs
177 stars 41 forks source link

weechat-matrix channel names #88

Closed malb closed 4 years ago

malb commented 4 years ago

weechat reports matrix channels by their human readable name but weechat.el only reports their internal ID: https://matrix.org/docs/projects/client/weechat-matrix Could this be fixed in weechat.el?

malb commented 4 years ago

nvm: /set matrix.look.human_buffer_names 1 does the trick

phil-s commented 4 years ago

Associated documentation from /set:

matrix.look.human_buffer_names: If turned on the buffer name will consist of the server name and the room name instead of the Matrix room ID. Note, this requires a change to the logger.file.mask setting since conflicts can happen otherwise (requires a script reload). [default: off]

In short, after setting (and /saveing?), I had to restart everything: kill the old buffers in Emacs and disconnect; quit weechat and re-run it (as running /script load matrix.py more than once produces an error); and then make a new relay connection in Emacs, after which I'm seeing the friendly aliases in Emacs.

phil-s commented 3 years ago

(I imagine this is actually a weechat or weechat-matrix issue, but I'll describe it here for starters...)

matrix.look.human_buffer_names is working in general, but sometimes I still wind up with a Matrix ID for the buffer name.

This is definitely happening if I start a chat with another user via the 'Element' matrix client (which I believe is currently the only way I can do it). At first, I am the only user in the room, and it is referred to as "Empty Room" in Weechat, and by its Matrix ID in Emacs. This undesirably-named Emacs buffer is created immediately/automatically.

weechat-sauron.el also sends a notification about it, the text of which does includes the username I started the chat with; however selecting that notification still opens the buffer with the Matrix ID name.

At this point I can also find this "Empty Room" (by that name) with M-x weechat-monitor-room.

At this point, sending chat messages to the room either via Emacs (using either of the two buffers) or via Element does not affect the room name according to Weechat.

However, in Weechat, as soon as I simply select that room then it is immediately renamed from "Empty Room" to a more appropriate name. At that point I can M-x weechat-monitor-room with that new/expected name.

So the workaround seems to be:

  1. Start the chat in Element
  2. Visit the room in Weechat
  3. M-x weechat-monitor-room in Emacs
  4. Kill the original/automated buffer in Emacs
  5. Actually start chatting...