From 1a112a90fd8edd5e3d910cab5ef1f09937c32d5f Mon Sep 17 00:00:00 2001 From: vvaltman Date: Wed, 27 May 2015 18:25:02 +0300 Subject: [PATCH] test.lua reverted --- test.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test.lua b/test.lua index 321f345..00d2a6b 100644 --- a/test.lua +++ b/test.lua @@ -57,6 +57,17 @@ function get_title (P, Q) end end +local lgi = require ('lgi') +local notify = lgi.require('Notify') +notify.init ("Telegram updates") +local icon = os.getenv("HOME") .. "/.telegram-cli/telegram-pics/telegram_64.png" + +function do_notify (user, msg) + local n = notify.Notification.new(user, msg, icon) + n:show () +end + +-- }}} function on_msg_receive (msg) if started == 0 then @@ -65,6 +76,7 @@ function on_msg_receive (msg) if msg.out then return end + do_notify (get_title (msg.from, msg.to), msg.text) if (msg.text == 'ping') then if (msg.to.id == our_id) then