Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

use a valid server name in WHOIS #107

Closed
wants to merge 1 commit into from

1 participant

@dominikh
Owner

Usually, it doesn't matter what you specify as the server in a WHOIS.
But in one case, freenode was sending us a "no such server" error that
didn't include the server name (then the nick) and thus break synced
attributes.

By specifying a real server, we'll always get a "no such nick" instead
of a "no such server".

Still need to check if this works on "weird" networks that are known to behave wrong.

@dominikh dominikh use a valid server name in WHOIS
Usually, it doesn't matter what you specify as the server in a WHOIS.
But in one case, freenode was sending us a "no such server" error that
didn't include the server name (then the nick) and thus break synced
attributes.

By specifying a real server, we'll always get a "no such nick" instead
of a "no such server".
6406b8e
@dominikh dominikh closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 27, 2012
  1. @dominikh

    use a valid server name in WHOIS

    dominikh authored
    Usually, it doesn't matter what you specify as the server in a WHOIS.
    But in one case, freenode was sending us a "no such server" error that
    didn't include the server name (then the nick) and thus break synced
    attributes.
    
    By specifying a real server, we'll always get a "no such nick" instead
    of a "no such server".
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 1 deletion.
  1. +5 −0 lib/cinch/irc.rb
  2. +1 −1  lib/cinch/user.rb
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.