matrix: Allow buffers to be switched by short names.

This patch overrides the /buffer command and modifies it so we can
switch to matrix buffers by their short name.
This commit is contained in:
Damir Jelić 2019-02-26 16:08:39 +01:00
parent 15b2d99047
commit 01b5d5c1c5
2 changed files with 57 additions and 0 deletions

View file

@ -803,6 +803,11 @@ class WeechatChannelBuffer(object):
def short_name(self):
return W.buffer_get_string(self._ptr, "short_name")
@property
def number(self):
"""Get the buffer number, starts at 1."""
return int(W.buffer_get_integer(self._ptr, "number"))
@short_name.setter
def short_name(self, name):
W.buffer_set(self._ptr, "short_name", name)