Changeset 362295025c0b9bb6ba98579047ab68b3fc5723a9

Show
Ignore:
Timestamp:
09/05/08 21:39:33 (3 months ago)
Author:
Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
git-committer:
Giuseppe Bilotta <giuseppe.bilotta@gmail.com> 1220636373 +0200
git-parent:

[b0ab2bf2815cb553a199faad1b9970c2193208df]

git-author:
Giuseppe Bilotta <giuseppe.bilotta@gmail.com> 1220636149 +0200
Message:

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.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lib/rbot/message.rb

    rb6bd9a2 r3622950  
    196196      @message = BasicUserMessage.strip_initial_formatting(@message) 
    197197 
    198       @address = true if source == @bot.myself 
     198      if target && target == @bot.myself 
     199        @address = true 
     200      end 
    199201 
    200202    end 
     
    322324      @action = false 
    323325 
    324       if @address = (target == @bot.myself) 
     326      if target == @bot.myself 
    325327        @private = true 
     328        @address = true 
    326329        @channel = nil 
    327330        @replyto = source 
     
    518521    def initialize(bot, server, source, oldnick, newnick) 
    519522      super(bot, server, source, oldnick, newnick) 
     523      @address = (source == @bot.myself) 
    520524      @is_on = [] 
    521525    end 
     
    541545    def initialize(bot, server, source, target, message="") 
    542546      super(bot, server, source, target, message) 
     547      @address = (source == @bot.myself) 
    543548      @modes = [] 
    544549    end 
     
    555560    def initialize(bot, server, source, target, whois) 
    556561      super(bot, server, source, target, "") 
     562      @address = (target == @bot.myself) 
    557563      @whois = whois 
    558564    end 
     
    625631      @channel = channel 
    626632      # in this case sourcenick is the nick that could be the bot 
     633      @address = (source == @bot.myself) 
    627634    end 
    628635  end