Created
November 30, 2008 13:39
-
-
Save mrkn/30434 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- net-irc/examples/tig.rb 2008-10-30 00:15:47.000000000 -0400 | |
+++ tig.rb 2008-11-30 08:48:29.000000000 -0500 | |
@@ -471,10 +471,16 @@ | |
post server_name, RPL_ENDOFWHO, @nick, channel | |
when @groups.key?(channel) | |
@groups[channel].each do |name| | |
- f = @friends.find {|i| i["screen_name"] == name } | |
- user = nick = f["screen_name"] | |
- host = serv = api_base.host | |
- real = f["name"] | |
+ if f = @friends.find {|i| i["screen_name"] == name } | |
+ user = nick = f["screen_name"] | |
+ host = serv = api_base.host | |
+ real = f["name"] | |
+ else | |
+ # 本来は API かスクレイピングでユーザ情報を取得すべき | |
+ user = nick = name | |
+ host = serv = api_base.host | |
+ real = name | |
+ end | |
post server_name, RPL_WHOREPLY, @nick, channel, user, host, serv, nick, "H*@", "0 #{real}" | |
end | |
post server_name, RPL_ENDOFWHO, @nick, channel | |
@@ -508,14 +514,14 @@ | |
nick, channel = *m.params | |
return if channel == main_channel | |
- if (@friends || []).find {|i| i["screen_name"] == nick } | |
+ #if (@friends || []).find {|i| i["screen_name"] == nick } | |
((@groups[channel] ||= []) << nick).uniq! | |
post "#{nick}!#{nick}@#{api_base.host}", JOIN, channel | |
post server_name, MODE, channel, "+o", nick | |
save_config | |
- else | |
- post ERR_NOSUCHNICK, nil, nick, "No such nick/channel" | |
- end | |
+ #else | |
+ # post ERR_NOSUCHNICK, nil, nick, "No such nick/channel" | |
+ #end | |
end | |
def on_kick(m) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment