More error messages.

This commit is contained in:
poljar (Damir Jelić) 2018-01-12 16:49:29 +01:00
parent 44c73b7cad
commit 2742796fa4

View file

@ -1314,6 +1314,13 @@ def check_server_existence(server_name, servers):
def matrix_command_help(args): def matrix_command_help(args):
if not args:
message = ("{prefix}matrix: Too few arguments for command "
"\"/matrix help\" (see the help for the command: "
"/matrix help help").format(prefix=W.prefix("error"))
W.prnt("", message)
return
for command in args: for command in args:
message = "" message = ""
@ -1405,6 +1412,8 @@ def matrix_command_help(args):
W.prnt("", "") W.prnt("", "")
W.prnt("", message) W.prnt("", message)
return
def matrix_server_command_listfull(args): def matrix_server_command_listfull(args):
def get_value_string(value, default_value): def get_value_string(value, default_value):
@ -1708,13 +1717,16 @@ def matrix_command_cb(data, buffer, args):
split_args = list(filter(bool, args.split(' '))) split_args = list(filter(bool, args.split(' ')))
command, args = split_args[0], split_args[1:] if len(split_args) < 1:
message = ("{prefix}matrix: Too few arguments for command "
if not command: "\"/matrix\" (see the help for the command: "
# TODO print out error "/help matrix").format(prefix=W.prefix("error"))
W.prnt("", message)
return W.WEECHAT_RC_ERROR return W.WEECHAT_RC_ERROR
elif command == 'connect': command, args = split_args[0], split_args[1:]
if command == 'connect':
connect_server(args) connect_server(args)
elif command == 'disconnect': elif command == 'disconnect':
@ -1828,7 +1840,9 @@ def matrix_command_topic_cb(data, buffer, command):
if not topic: if not topic:
room = server.rooms[room_id] room = server.rooms[room_id]
if room.topic: if not room.topic:
return W.WEECHAT_RC_OK
message = ("{prefix}Topic for {color}{room}{ncolor} is " message = ("{prefix}Topic for {color}{room}{ncolor} is "
"\"{topic}\"").format( "\"{topic}\"").format(
prefix=W.prefix("network"), prefix=W.prefix("network"),