Events don't have a msg property set, making them hard to match in hook patterns

RESOLVED FIXED

Status

--
minor
RESOLVED FIXED
14 years ago
13 years ago

People

(Reporter: Gijs, Assigned: Gijs)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [cz-patch][cz-0.9.68.2])

Attachments

(1 attachment, 1 obsolete attachment)

1.05 KB, patch
bugzilla-mozilla-20000923
: review+
Details | Diff | Splinter Review
(Assignee)

Description

14 years ago
Currently, ChatZilla does not store the contents of PRIVMSG or NOTICE messages
on an event. This would be very useful when hooking specific kinds of messages.
Right now, someone who would want to do that has no choice but to hook *all*
PRIVMSG or NOTICE messages and match the message later on, or use complicated
lambda functions.

I believe minimal modifications should make it possible to store the message in
e.msg to make it available for matching by hook patterns.
(Assignee)

Updated

14 years ago
Assignee: rginda → gijskruitbosch
(Assignee)

Comment 1

14 years ago
Created attachment 181295 [details] [diff] [review]
Patch v1

Patch to add e.msg in onNotice and onPrivmsg. We can't do it earlier because we
are not sure of the target (and thus not sure of the character encoding we
should use)
Attachment #181295 - Flags: review?(silver)

Comment 2

14 years ago
Comment on attachment 181295 [details] [diff] [review]
Patch v1

>Index: mozilla/extensions/irc/js/lib/irc.js

>+    e.msg = e.decodeParam(2, e[e.set]);

Is there something wrong with e.replyTo as the 2nd param? :)


>     else
>         e.destObject = e.replyTo;
> 
>+    if (e.set != "server")
>+        e.msg = e.decodeParam(2, e[e.set]);

Why not put it in the else part above?
(Assignee)

Comment 3

14 years ago
Created attachment 181298 [details] [diff] [review]
Patch v2

Maybe next time I ought to not give the patch a version number. It sparks off
the wrong ideas ;-).
Attachment #181295 - Attachment is obsolete: true
Attachment #181298 - Flags: review?(silver)
(Assignee)

Updated

14 years ago
Attachment #181295 - Flags: review?(silver) → review-

Comment 4

14 years ago
Comment on attachment 181298 [details] [diff] [review]
Patch v2

r=silver@warwickcompsoc.co.uk
Attachment #181298 - Flags: review?(silver) → review+
(Assignee)

Updated

14 years ago
Whiteboard: cz-patch

Updated

14 years ago
Attachment #181298 - Flags: approval1.8b2?
(Assignee)

Updated

14 years ago
Summary: Event don't have a msg property set, making them hard to match in hook patterns → Events don't have a msg property set, making them hard to match in hook patterns

Comment 5

14 years ago
Comment on attachment 181298 [details] [diff] [review]
Patch v2

a=asa
Attachment #181298 - Flags: approval1.8b2? → approval1.8b2+

Comment 6

14 years ago
Checked in --> FIXED.

Automated builds at http://twpol.dyndns.org/mozilla/chatzilla/nightly/ will
include this shortly.
Status: NEW → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → FIXED

Updated

13 years ago
Whiteboard: cz-patch → [cz-patch][cz-0.9.68.2]
You need to log in before you can comment on or make changes to this bug.