Skip to content

Commit

Permalink
ちょこちょこ変更
Browse files Browse the repository at this point in the history
  • Loading branch information
jugyo committed Apr 30, 2009
1 parent d00d778 commit 5ef7515
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions lib/plugins/irc_gw.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ def main_channel; '#termtter' end
def initialize(*args)
super
@@listners << self
Thread.start do
sleep 1
self.call(@@last_statuses || [], :update_friends_timeline)
end
end

def call(statuses, event)
Expand All @@ -49,25 +45,23 @@ def call(statuses, event)
end

statuses.each do |s|
post s.user.screen_name, msg_type, main_channel, s.text
post s.user.screen_name, msg_type, main_channel, [s.text, s.id].join(' ')
end
end

def on_message(m)
begin
termtter_command = m.command.downcase + ' ' + m.params.join(' ')
unless Termtter::Client.find_commands(termtter_command).empty?
post '#termtter', NOTICE, main_channel, '> ' + termtter_command
Termtter::Client.call_commands(termtter_command)
end
rescue Termtter::CommandNotFound => e
super
termtter_command = m.command.downcase + ' ' + m.params.join(' ')
unless Termtter::Client.find_commands(termtter_command).empty?
post '#termtter', NOTICE, main_channel, '> ' + termtter_command
Termtter::Client.call_commands(termtter_command)
end
end

def on_user(m)
super
post @prefix, JOIN, main_channel
post server_name, MODE, main_channel, "+o", @prefix.nick
self.call(@@last_statuses || [], :update_friends_timeline)
end

def on_privmsg(m)
Expand Down

0 comments on commit 5ef7515

Please sign in to comment.