Closed Bug 480936 Opened 16 years ago Closed 16 years ago

Implement /delay N somecommand

Categories

(Other Applications Graveyard :: ChatZilla, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: Gijs, Assigned: Gijs)

Details

(Whiteboard: [cz-0.9.86])

Attachments

(1 file)

2.86 KB, patch
bugzilla-mozilla-20000923
: review+
Details | Diff | Splinter Review
Spun off from bug 476933. I don't really think it would be as useful to have a type of special marker in the autoperform list that would delay the rest of the autoperform. Instead, I think implementing an actual command that delays execution for the <rest> of its arguments by N seconds would be easier and more versatile (could also easily do an alias for timed bans, for instance). Presumably this would work approximately like this: cmd.delay.params = <delay> <rest> function cmdDelay(e) { setTimeout(dispatch, e.delay * 1000, e.rest, e, e.isInteractive, undefined); } (setting all the params because otherwise the timeout difference will be filled in there, potentially breaking things - could work around that with an anonymous function as well, if desired)
For those wanting this functionality in current builds, the following alias should suffice. /alias delay eval var obj = this\; setTimeout(function() { obj.dispatch("$(2+)") },$(1) * 1000)
I think /delayed would be a better name; /delay sounds like a blocking sleep, where as this would execute the command asynchronously.
Attached patch PatchSplinter Review
File it, fix it, as they say...
Assignee: rginda → gijskruitbosch+bugs
Status: NEW → ASSIGNED
Attachment #410595 - Flags: review?(silver)
Attachment #410595 - Flags: review?(silver) → review+
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Whiteboard: [cz-0.9.86]
Product: Other Applications → Other Applications Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: