Skip to content

use a valid server name in WHOIS #107

Closed
wants to merge 1 commit into from
View
5 lib/cinch/irc.rb
@@ -18,9 +18,13 @@ class IRC
# @return [Network] The detected network
attr_reader :network
+ # @return [String] The specific server we are connected to
+ attr_reader :server
+
def initialize(bot)
@bot = bot
@isupport = ISupport.new
+ @server = nil
end
# @return [TCPSocket]
@@ -566,6 +570,7 @@ def process_dcc_send(filename, ip, port, size, m, events)
def on_001(msg, events)
# Ensure that we know our real, possibly truncated or otherwise
# modified nick.
+ @server = msg.prefix
@bot.set_nick msg.params.first
end
View
2 lib/cinch/user.rb
@@ -154,7 +154,7 @@ def whois
if @bot.irc.network.whois_only_one_argument?
@bot.irc.send "WHOIS #@name"
else
- @bot.irc.send "WHOIS #@name #@name"
+ @bot.irc.send "WHOIS #{@bot.irc.server} #@name"
end
end
alias_method :refresh, :whois
Something went wrong with that request. Please try again.