encryption: Add a error message for the olm command.
This commit is contained in:
parent
9e86ccc3f7
commit
658ec67ff4
1 changed files with 6 additions and 2 deletions
|
@ -42,7 +42,7 @@ from matrix.globals import W, SERVERS
|
|||
from matrix.utf import utf8_decode
|
||||
|
||||
|
||||
def own_buffer(f):
|
||||
def own_buffer_or_error(f):
|
||||
|
||||
@wraps(f)
|
||||
def wrapper(data, buffer, *args, **kwargs):
|
||||
|
@ -53,6 +53,10 @@ def own_buffer(f):
|
|||
elif buffer == server.server_buffer:
|
||||
return f(server.name, buffer, *args, **kwargs)
|
||||
|
||||
W.prnt("", "{prefix}matrix: command \"olm\" must be executed on a "
|
||||
"matrix buffer (server or channel)".format(
|
||||
prefix=W.prefix("error")))
|
||||
|
||||
return W.WEECHAT_RC_OK
|
||||
|
||||
return wrapper
|
||||
|
@ -118,7 +122,7 @@ def partition_key(key):
|
|||
return ' '.join(''.join(g) for g in groups)
|
||||
|
||||
|
||||
@own_buffer
|
||||
@own_buffer_or_error
|
||||
@utf8_decode
|
||||
def matrix_olm_command_cb(server_name, buffer, args):
|
||||
server = SERVERS[server_name]
|
||||
|
|
Loading…
Reference in a new issue