Fixe Notify

This commit is contained in:
Andreas Bielawski 2016-08-16 20:52:56 +02:00
parent e3e068da00
commit e022ddc9f7

View File

@ -37,10 +37,8 @@ function notify:pre_process(msg, self)
-- so that we don't send the user some private text, when he/she is not -- so that we don't send the user some private text, when he/she is not
-- in the group. -- in the group.
if redis:sismember('chat:'..chat_id..':users', id) then if redis:sismember('chat:'..chat_id..':users', id) then
-- ignore message, if user is mentioning him/herself -- ignore message, if user is mentioning him/herself
if id == tostring(msg.from.id) then break; end if id ~= tostring(msg.from.id) then
local send_date = run_command('date -d @'..msg.date..' +"%d.%m.%Y um %H:%M:%S Uhr"') local send_date = run_command('date -d @'..msg.date..' +"%d.%m.%Y um %H:%M:%S Uhr"')
local send_date = string.gsub(send_date, "\n", "") local send_date = string.gsub(send_date, "\n", "")
local from = string.gsub(msg.from.name, "%_", " ") local from = string.gsub(msg.from.name, "%_", " ")
@ -52,6 +50,7 @@ function notify:pre_process(msg, self)
end end
end end
end end
end
return msg return msg
end end