From 9644ae5b65fe0aae23a63599ac185a460c99c1fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Wed, 16 Jan 2019 21:21:50 +0100 Subject: [PATCH] matrix: Don't send out read markers with an empty event id. --- main.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index e4ec72f..1790b75 100644 --- a/main.py +++ b/main.py @@ -490,9 +490,13 @@ def buffer_switch_cb(_, _signal, buffer_ptr): if room_buffer.should_send_read_marker: event_id = room_buffer.last_event_id - server.room_send_read_marker( - room_buffer.room.room_id, event_id) - room_buffer.last_read_event = event_id + + # A buffer may not have any events, in that case no event id is + # here returned + if event_id: + server.room_send_read_marker( + room_buffer.room.room_id, event_id) + room_buffer.last_read_event = event_id if room_buffer.members_fetched: return W.WEECHAT_RC_OK