Changeset b6bd9a24014ac9fbc822e9051f216f0506f24cd5
- Timestamp:
- 08/13/08 08:06:33
(3 months ago)
- Author:
- Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
- git-committer:
- Giuseppe Bilotta <giuseppe.bilotta@gmail.com> 1218600393 +0200
- git-parent:
[940264d1718b5a32d34ac82276a29f0cc1a51941]
- git-author:
- Giuseppe Bilotta <giuseppe.bilotta@gmail.com> 1218600393 +0200
- Message:
message.rb: fix message addressing logic
IRC messages which are not PRIVMSG or NOTICE (i.e. not UserMessage?) are
'addressed' to the bot when they originate from it.
Rather than putting this logic in each one of them (and forgetting about
it for some, e.g. NICK messages), put it in BasicUserMessage?. Compensate
by always setting @address in UserMessage? to test against target
instead.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| reebdc69 |
rb6bd9a2 |
|
| 196 | 196 | @message = BasicUserMessage.strip_initial_formatting(@message) |
|---|
| 197 | 197 | |
|---|
| 198 | | if target && target == @bot.myself |
|---|
| 199 | | @address = true |
|---|
| 200 | | end |
|---|
| | 198 | @address = true if source == @bot.myself |
|---|
| 201 | 199 | |
|---|
| 202 | 200 | end |
|---|
| … | … | |
| 324 | 322 | @action = false |
|---|
| 325 | 323 | |
|---|
| 326 | | if target == @bot.myself |
|---|
| | 324 | if @address = (target == @bot.myself) |
|---|
| 327 | 325 | @private = true |
|---|
| 328 | | @address = true |
|---|
| 329 | 326 | @channel = nil |
|---|
| 330 | 327 | @replyto = source |
|---|
| … | … | |
| 544 | 541 | def initialize(bot, server, source, target, message="") |
|---|
| 545 | 542 | super(bot, server, source, target, message) |
|---|
| 546 | | @address = (source == @bot.myself) |
|---|
| 547 | 543 | @modes = [] |
|---|
| 548 | 544 | end |
|---|
| … | … | |
| 559 | 555 | def initialize(bot, server, source, target, whois) |
|---|
| 560 | 556 | super(bot, server, source, target, "") |
|---|
| 561 | | @address = (target == @bot.myself) |
|---|
| 562 | 557 | @whois = whois |
|---|
| 563 | 558 | end |
|---|
| … | … | |
| 630 | 625 | @channel = channel |
|---|
| 631 | 626 | # in this case sourcenick is the nick that could be the bot |
|---|
| 632 | | @address = (source == @bot.myself) |
|---|
| 633 | 627 | end |
|---|
| 634 | 628 | end |
|---|