diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2008-02-22 21:22:37 +0100 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2008-02-22 21:22:37 +0100 |
commit | ee14034b131b68a6f213612c2a9882e942f31e47 (patch) | |
tree | 189a4fd9e59ddfda09161ea999b96a1c596e6e33 | |
parent | edb270838305ee330480bc0fb4060b11af4ff128 (diff) |
twitter plugin: use m.notify when twitting actions
-rw-r--r-- | data/rbot/plugins/twitter.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/data/rbot/plugins/twitter.rb b/data/rbot/plugins/twitter.rb index 0ac88ef7..0aabe660 100644 --- a/data/rbot/plugins/twitter.rb +++ b/data/rbot/plugins/twitter.rb @@ -136,10 +136,11 @@ class TwitterPlugin < Plugin response = @bot.httputil.post(uri, body, :headers => @header) debug response + reply_method = params[:notify] ? :notify : :reply if response.class == Net::HTTPOK - m.reply "status updated" + m.__send__(reply_method, "status updated") else - m.reply "could not update status" + m.__send__(reply_method, "could not update status") end end @@ -154,7 +155,7 @@ class TwitterPlugin < Plugin def ctcp_listen(m) return unless m.action? return unless @registry[m.sourcenick + "_actions"] - update_status(m, :status => m.message) + update_status(m, :status => m.message, :notify => true) end # show or toggle action twitting |