Skip to content

Commit 243dc2a

Browse files
committed
nilcheck on redaction id. Fixes #115
1 parent 5e21bcc commit 243dc2a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

matrix.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ end
419419
function configuration_changed_cb(data, option, value)
420420
if option == 'plugins.var.lua.matrix.timeout' then
421421
timeout = tonumber(value)*1000
422-
elseif option == 'plugins.var.lua.matrix.debug' then
422+
elseif option == 'plugins.var.lua.matrix.debug' then
423423
if value == 'on' then
424424
DEBUG = true
425425
w.print('', SCRIPT_NAME..': debugging messages enabled')
@@ -2167,6 +2167,7 @@ function Room:delNick(id)
21672167
end
21682168

21692169
function Room:UpdateLine(id, message)
2170+
if not id then return end
21702171
local lines = w.hdata_pointer(w.hdata_get('buffer'), self.buffer, 'own_lines')
21712172
if lines == '' then return end
21722173
local line = w.hdata_pointer(w.hdata_get('lines'), lines, 'last_line')
@@ -2716,7 +2717,7 @@ function Room:ParseChunk(chunk, backlog, chunktype)
27162717
local result = self:UpdateLine(redact_id, w.color'darkgray'..'(redacted)')
27172718
if not result and not backlog then
27182719
-- backlog doesn't send original message
2719-
perr 'Could not find message to redact :('
2720+
perr(('Could not find message to redact :(. Redaction ID is: %s'):format(redact_id))
27202721
end
27212722
elseif chunk['type'] == 'm.room.history_visibility' then
27222723
self.history_visibility = chunk.content.history_visibility

0 commit comments

Comments
 (0)