summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/rbot/message.rb15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/rbot/message.rb b/lib/rbot/message.rb
index 42042b88..c671e00a 100644
--- a/lib/rbot/message.rb
+++ b/lib/rbot/message.rb
@@ -150,13 +150,24 @@ module Irc
# Access the nick of the source
#
def sourcenick
- @source.nick
+ if @source.reply_to?(:nick)
+ @source.nick
+ else
+ @source.to_s
+ end
end
# Access the user@host of the source
#
def sourceaddress
- "#{@source.user}@#{@source.host}"
+ str = String.new
+ if @source.reply_to?(:user)
+ str << @source.user.to_s
+ end
+ if @source.reply_to?(:host)
+ str << @source.host.to_s
+ end
+ str
end
# Was the message from an identified user?