diff --git a/matrix/encryption.py b/matrix/encryption.py index d8e9803..ff7d1d2 100644 --- a/matrix/encryption.py +++ b/matrix/encryption.py @@ -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]