From 73f6b8d54c555cbb2acfc619b238c81464572858 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 18 Apr 2012 15:14:06 +0200 Subject: [PATCH] Removed debugging messages. --- app/models/channel/twitter2.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/models/channel/twitter2.rb b/app/models/channel/twitter2.rb index 475200291..cafcc4a65 100644 --- a/app/models/channel/twitter2.rb +++ b/app/models/channel/twitter2.rb @@ -213,9 +213,11 @@ class Channel::Twitter2 end - def send(atts, channel) + def send(attr, notification = false) # logger.debug('tweeeeettttt!!!!!!') - @client = Twitter::Client.new( + channel = Channel.where( :area => 'Twitter::Inbound', :active => true ).first + + client = Twitter::Client.new( :consumer_key => channel[:options][:consumer_key], :consumer_secret => channel[:options][:consumer_secret], :oauth_token => channel[:options][:oauth_token], @@ -223,23 +225,23 @@ class Channel::Twitter2 ) puts 'to:' + atts[:to].to_s if atts[:type] == 'twitter direct-message' then - dm = @client.direct_message_create( + dm = client.direct_message_create( atts[:to].to_s, atts[:body].to_s, options = {} ) - puts dm.inspect +# puts dm.inspect return dm end if atts[:type] == 'twitter status' then - message = @client.update( + message = client.update( atts[:body].to_s, options = { :in_reply_to_status_id => atts[:in_reply_to] } ) - puts message.inspect +# puts message.inspect return message end