Closed
Bug 790341
Opened 13 years ago
Closed 13 years ago
/delayed command loses execution context for command
Categories
(Other Applications Graveyard :: ChatZilla, defect)
Other Applications Graveyard
ChatZilla
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: bugzilla-mozilla-20000923, Assigned: dsarratt)
Details
(Whiteboard: [cz-0.9.90])
Attachments
(1 file, 1 obsolete file)
|
755 bytes,
patch
|
bugzilla-mozilla-20000923
:
review+
|
Details | Diff | Splinter Review |
When a command is executed, it has a context (stored in "e"), which contains the sourceObject and related data about where it was run. Many commands operate on this. The /delayed command does not preserve this when executing its delayed command argument, meaning that the current view is used instead of the one the /delayed command was executed on. This can be especially bad for auto-perform /delayed commands.
| Assignee | ||
Comment 1•13 years ago
|
||
Passing the context to the dispatch() call seems to fix this, for both auto-performed and manually-entered delays. I don't think there's a situation where the context could be deleted between the cmdDelayed() call and the dispatch() call, but if it does get deleted we just have a reversion to previous behaviour (using the current view).
| Reporter | ||
Comment 2•13 years ago
|
||
Comment on attachment 687468 [details] [diff] [review]
Make delayed commands execute in the proper view.
Review of attachment 687468 [details] [diff] [review]:
-----------------------------------------------------------------
Happy with this patch if either modification I suggest resolves the issue I believe exists (or you can show the issue doesn't exist).
::: xul/content/commands.js
@@ +1113,4 @@
> {
> function _dispatch()
> {
> + dispatch(e.rest, e, e.isInteractive);
I believe we need to delete e.inputData before this call, otherwise if you delay an unknown command with no arguments it messes up and sends "/quote command delay command" (i.e. appends the /delayed arguments).
(We could also fix that in dispatch() itself, where it sets e.inputData to ary[2] on line 349, by adding an else which sets it to "".)
Attachment #687468 -
Flags: review? → review+
| Assignee | ||
Comment 3•13 years ago
|
||
That bug you mentioned applies to any command with no arguments (e.g. "/delayed 5 leave" will attempt to leave a channel called 5 if run outside a channel view). I wasn't able to track down what's causing this, but the fix you mentioned does work.
Attachment #687468 -
Attachment is obsolete: true
Attachment #692552 -
Flags: review?
| Reporter | ||
Comment 4•13 years ago
|
||
Comment on attachment 692552 [details] [diff] [review]
Fix for bug 790341
Review of attachment 692552 [details] [diff] [review]:
-----------------------------------------------------------------
Thanks!
The problem was that after splitting command and arguments at http://hg.mozilla.org/chatzilla/file/aef5fb39a211/xul/content/commands.js#l339 we only set e.inputData if it was split, not when it is just a command (which is what we have in this patch).
Attachment #692552 -
Flags: review? → review+
| Reporter | ||
Comment 5•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
| Reporter | ||
Updated•13 years ago
|
Whiteboard: [cz-0.9.90]
Updated•1 year ago
|
Product: Other Applications → Other Applications Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•