Fix server buffer merging if no server buffers are created.
This commit is contained in:
parent
90c63c197c
commit
e39fa57f83
2 changed files with 11 additions and 5 deletions
|
@ -45,7 +45,8 @@ def matrix_config_change_cb(data, option):
|
||||||
OPTIONS.look_server_buf = ServerBufferType(
|
OPTIONS.look_server_buf = ServerBufferType(
|
||||||
W.config_integer(option))
|
W.config_integer(option))
|
||||||
for server in SERVERS.values():
|
for server in SERVERS.values():
|
||||||
server_buffer_merge(server.server_buffer)
|
if server.server_buffer:
|
||||||
|
server_buffer_merge(server.server_buffer)
|
||||||
|
|
||||||
elif option_name == "max_initial_sync_events":
|
elif option_name == "max_initial_sync_events":
|
||||||
OPTIONS.sync_limit = W.config_integer(option)
|
OPTIONS.sync_limit = W.config_integer(option)
|
||||||
|
|
|
@ -84,10 +84,15 @@ def server_buffer_merge(buffer):
|
||||||
W.buffer_merge(buffer, W.buffer_search_main())
|
W.buffer_merge(buffer, W.buffer_search_main())
|
||||||
elif OPTIONS.look_server_buf == ServerBufferType.MERGE:
|
elif OPTIONS.look_server_buf == ServerBufferType.MERGE:
|
||||||
if SERVERS:
|
if SERVERS:
|
||||||
first = list(SERVERS.values())[0].server_buffer
|
first = None
|
||||||
num = W.buffer_get_integer(W.buffer_search_main(), "number")
|
for server in SERVERS.values():
|
||||||
W.buffer_unmerge(buffer, num + 1)
|
if server.server_buffer and buffer is not server.server_buffer:
|
||||||
W.buffer_merge(buffer, first)
|
first = server.server_buffer
|
||||||
|
break
|
||||||
|
if first:
|
||||||
|
num = W.buffer_get_integer(W.buffer_search_main(), "number")
|
||||||
|
W.buffer_unmerge(buffer, num + 1)
|
||||||
|
W.buffer_merge(buffer, first)
|
||||||
else:
|
else:
|
||||||
num = W.buffer_get_integer(W.buffer_search_main(), "number")
|
num = W.buffer_get_integer(W.buffer_search_main(), "number")
|
||||||
W.buffer_unmerge(buffer, num + 1)
|
W.buffer_unmerge(buffer, num + 1)
|
||||||
|
|
Loading…
Add table
Reference in a new issue