From 934863e209145db7638cce95140a88c38ec8eff2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Tue, 2 Jul 2019 18:11:28 +0200 Subject: [PATCH] buffer: Change the way the domain localvar is set. Room ids in newer room versions will become opaque strings and won't contain the domain of the homeserver. Get the domain from the homeserver url instead. --- matrix/buffer.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/matrix/buffer.py b/matrix/buffer.py index 279c12d..3bb9acb 100644 --- a/matrix/buffer.py +++ b/matrix/buffer.py @@ -885,15 +885,11 @@ class RoomBuffer(object): buffer_name, server_name, user ) - try: - _, room_domain = room.room_id.split(":", 1) - W.buffer_set( - self.weechat_buffer._ptr, - "localvar_set_domain", - room_domain - ) - except ValueError: - pass + W.buffer_set( + self.weechat_buffer._ptr, + "localvar_set_domain", + self.homeserver.hostname + ) W.buffer_set( self.weechat_buffer._ptr,