summaryrefslogtreecommitdiff
path: root/lib/rbot/rfc2812.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rbot/rfc2812.rb')
-rw-r--r--lib/rbot/rfc2812.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/rbot/rfc2812.rb b/lib/rbot/rfc2812.rb
index 97181b03..efa50035 100644
--- a/lib/rbot/rfc2812.rb
+++ b/lib/rbot/rfc2812.rb
@@ -902,13 +902,14 @@ module Irc
# This is not always true, though, since some servers do not send a
# full hostmask for user messages.
#
- if prefix =~ /^(?:\S+)(?:!\S+)?@(?:\S+)$/
+ if prefix =~ /^#{Regexp::Irc::GEN_MASK}$/
data[:source] = @server.user(prefix)
else
if @server.hostname
if @server.hostname != prefix
- debug "Origin #{prefix} for message\n\t#{serverstring.inspect}\nis neither a user hostmask nor the server hostname, assuming it's a nick"
- data[:source] = @server.user(prefix)
+ # TODO do we want to be able to differentiated messages that are passed on to us from /other/ servers?
+ debug "Origin #{prefix} for message\n\t#{serverstring.inspect}\nis neither a user hostmask nor the server hostname\nI'll pretend that it's from the server anyway"
+ data[:source] = @server
else
data[:source] = @server
end