]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - lib/rbot/message.rb
* (timer) stop the bot timer for shutdown / rescan
[user/henk/code/ruby/rbot.git] / lib / rbot / message.rb
index c671e00a672e7bdce7213a0baa86a4bf22f4cc73..c539843bcc7286f6496d0d5419766960163e5b96 100644 (file)
@@ -150,24 +150,13 @@ module Irc
     # Access the nick of the source
     #
     def sourcenick
-      if @source.reply_to?(:nick)
-        @source.nick
-      else
-        @source.to_s
-      end
+      @source.nick rescue @source.to_s
     end
 
     # Access the user@host of the source
     #
     def sourceaddress
-      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
+      "#{@source.user}@#{@source.host}" rescue @source.to_s
     end
 
     # Was the message from an identified user?