completion: Add a room name completion.
This is meant to be used as another default_template for the global weechat completion.
This commit is contained in:
parent
6ddf63093a
commit
75b2b85626
2 changed files with 23 additions and 1 deletions
|
|
@ -280,6 +280,20 @@ def matrix_user_completion_cb(data, completion_item, buffer, completion):
|
|||
return W.WEECHAT_RC_OK
|
||||
|
||||
|
||||
@utf8_decode
|
||||
def matrix_room_completion_cb(data, completion_item, buffer, completion):
|
||||
"""Completion callback for matrix room names."""
|
||||
for server in SERVERS.values():
|
||||
for room_buffer in server.room_buffers.values():
|
||||
name = room_buffer.weechat_buffer.short_name
|
||||
|
||||
W.hook_completion_list_add(
|
||||
completion, name, 0, W.WEECHAT_LIST_POS_SORT
|
||||
)
|
||||
|
||||
return W.WEECHAT_RC_OK
|
||||
|
||||
|
||||
def init_completion():
|
||||
W.hook_completion(
|
||||
"matrix_server_commands",
|
||||
|
|
@ -343,3 +357,10 @@ def init_completion():
|
|||
"matrix_own_devices_completion_cb",
|
||||
"",
|
||||
)
|
||||
|
||||
W.hook_completion(
|
||||
"matrix_rooms",
|
||||
"Matrix room name completion",
|
||||
"matrix_room_completion_cb",
|
||||
"",
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue