summaryrefslogtreecommitdiff
path: root/lib/rbot/message.rb
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2008-09-05 19:35:49 +0200
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2008-09-05 19:39:33 +0200
commit362295025c0b9bb6ba98579047ab68b3fc5723a9 (patch)
treec59a64db89f2fc6f2184df6d479d9322c5dca255 /lib/rbot/message.rb
parentb0ab2bf2815cb553a199faad1b9970c2193208df (diff)
message.rb: fix the fix to message addressing logic
This reverts commit b6bd9a24014ac9fbc822e9051f216f0506f24cd5 "message.rb: fix message addressing logic" since it actually breaks the validity for address? in a number of cases. Instead, add proper @address setting to NickMessage which is the only one getting it wrong presently.
Diffstat (limited to 'lib/rbot/message.rb')
-rw-r--r--lib/rbot/message.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/rbot/message.rb b/lib/rbot/message.rb
index f6e38e80..b34105c4 100644
--- a/lib/rbot/message.rb
+++ b/lib/rbot/message.rb
@@ -195,7 +195,9 @@ module Irc
@plainmessage = BasicUserMessage.strip_formatting(@message)
@message = BasicUserMessage.strip_initial_formatting(@message)
- @address = true if source == @bot.myself
+ if target && target == @bot.myself
+ @address = true
+ end
end
@@ -321,8 +323,9 @@ module Irc
@ctcp = false
@action = false
- if @address = (target == @bot.myself)
+ if target == @bot.myself
@private = true
+ @address = true
@channel = nil
@replyto = source
else
@@ -517,6 +520,7 @@ module Irc
attr_accessor :is_on
def initialize(bot, server, source, oldnick, newnick)
super(bot, server, source, oldnick, newnick)
+ @address = (source == @bot.myself)
@is_on = []
end
@@ -540,6 +544,7 @@ module Irc
attr_accessor :modes
def initialize(bot, server, source, target, message="")
super(bot, server, source, target, message)
+ @address = (source == @bot.myself)
@modes = []
end
@@ -554,6 +559,7 @@ module Irc
attr_reader :whois
def initialize(bot, server, source, target, whois)
super(bot, server, source, target, "")
+ @address = (target == @bot.myself)
@whois = whois
end
@@ -624,6 +630,7 @@ module Irc
super(bot, server, source, channel, message)
@channel = channel
# in this case sourcenick is the nick that could be the bot
+ @address = (source == @bot.myself)
end
end