ChatZilla should have an auto-away feature

RESOLVED FIXED

Status

Other Applications
ChatZilla
--
enhancement
RESOLVED FIXED
10 years ago
10 years ago

People

(Reporter: Bryan, Assigned: Gijs)

Tracking

Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [cz-0.9.80])

Attachments

(1 attachment, 1 obsolete attachment)

18.93 KB, patch
James Ross
: review+
Details | Diff | Splinter Review
(Reporter)

Description

10 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4
Build Identifier: ChatZilla 0.9.78.1 [Firefox 2.0.0.4/2007051502]

i've installed an irc server at work and i've recommended all employees install and use chatzilla.  so first, thank you for an excellent, clean and professional looking client.  one of the features that is has been asked for by just about everyone is a preference to set how many minutes of computer idle time will automatically set the nickname to the away-name.  then when the computer is not idle anymore, the name automatically change back to the nickname.   right now, nobody remembers to manually change their nickname, so this would be a very valuable feature to have. 

Reproducible: Always

Steps to Reproduce:
1.
2.
3.
(Assignee)

Comment 1

10 years ago
Mmhmm, how ironic. I've been too lazy to file this bug myself - this is actually possible now that I added the necessary APIs to Firefox, but unfortunately those only exist on Firefox 3 trunk builds. So even if we implement this, it will only work on Firefox 3 (including current alphas and betas), and concurrent XULRunner trunk builds. I'm not sure you'll want your employees running alpha/beta software :-). For Firefox 2 (and XULRunner 1.8.1 and the like), the APIs simply don't exist and it's impossible for us to do what you ask. :-(

As for nickname changing, you can actually set an away nickname in the preferences This would be "Nickname (away)" in the "Identification" section of the General tab. You can set it globally and per network. Then you can just use /away or the nickname button and your nickname will automagically change, and change back when you use /back or the nickname button again.

If anyone else wants to have a go at implementing this, be my guest. I'm going to be busy the next week and probably after that. Uni sucks :-(. Please note that I'm being, erm, 'convinced' to change the API, (to use seconds instead of minutes for the listener delay period). That's bug 380682.

Oh, and this is obviously a valid RFE, so confirming.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows XP → All
Hardware: PC → All
Version: unspecified → Trunk
(Assignee)

Updated

10 years ago
Summary: auto-away → ChatZilla should have an auto-away feature
(Assignee)

Comment 2

10 years ago
Created attachment 282379 [details] [diff] [review]
Patch

In addition to implementing this stuff, I've taken the liberty to replace some "host application (eg. Mozilla, Firefox)" references with &brandShortName;. Seemed neater to me.
Assignee: rginda → gijskruitbosch+bugs
Status: NEW → ASSIGNED
Attachment #282379 - Flags: review?(silver)

Comment 3

10 years ago
Comment on attachment 282379 [details] [diff] [review]
Patch

>Index: mozilla/extensions/irc/locales/en-US/chrome/chatzilla.properties
>+msg.err.no.idleservice = ChatZilla can't determine if you're away in your version of &brandShortName;. The auto-away feature will now be disabled.

"can't determine when you're away"

>Index: mozilla/extensions/irc/xul/content/commands.js
>-            display(getMsg(MSG_AWAY_ON, e.reason));
>+            client.display(getMsg(MSG_AWAY_ON, e.reason));

Sure this wont force the tab to appear if it isn't already?

>Index: mozilla/extensions/irc/xul/content/prefs.js
>+         ["idleAutoAway",       0,        ".ident"],

I'd prefer it starting "away", perhaps "awayIdleTime"?

>             break;
>+        

Nit: whitespace.

>+        case "idleAutoAway":

>Index: mozilla/extensions/irc/xul/content/static.js
>+function initIdleAutoAway(timeout)
>+{
>+    if (!timeout)
>+        return;

>+function uninitIdleAutoAway(timeout)
>+{
>+    // Don't try to do anything if we were disabled before
>+    if (timeout == 0)
>+        return;

You used if (!timeout) in initIdleAutoAway. Are you expecting a difference or should they be the same? Using the same comment would be nice, too.

>+
>+    var is = getService("@mozilla.org/widget/idleservice;1", "nsIIdleService");
>+    if (!is)
>+        return;

Nit: add blank line after this.

>+    try

r=silver with those nits fixed.
Attachment #282379 - Flags: review?(silver) → review+
(Assignee)

Comment 4

10 years ago
Comment on attachment 282379 [details] [diff] [review]
Patch

Er, so I just realized this will override existing away states. Oops.
Attachment #282379 - Flags: review-
(Assignee)

Updated

10 years ago
Depends on: 402533
(Assignee)

Updated

10 years ago
Attachment #282379 - Attachment is obsolete: true
(Assignee)

Comment 5

10 years ago
Created attachment 293290 [details] [diff] [review]
Patch

So this fixes the nits and stops us from killing your current away state.
Attachment #293290 - Flags: review?(silver)

Comment 6

10 years ago
Comment on attachment 293290 [details] [diff] [review]
Patch

You didn't put a blank line after:
>+    if (!is)
>+        return;

But otherwise, looks good. r=silver with nit fixed.
Attachment #293290 - Flags: review?(silver) → review+
(Assignee)

Comment 7

10 years ago
Checking in mozilla/extensions/irc/locales/en-US/chrome/chatzilla.properties;
/cvsroot/mozilla/extensions/irc/locales/en-US/chrome/chatzilla.properties,v  <--  chatzilla.properties
new revision: 1.149; previous revision: 1.148
done
Checking in mozilla/extensions/irc/xul/content/commands.js;
/cvsroot/mozilla/extensions/irc/xul/content/commands.js,v  <--  commands.js
new revision: 1.138; previous revision: 1.137
done
Checking in mozilla/extensions/irc/xul/content/handlers.js;
/cvsroot/mozilla/extensions/irc/xul/content/handlers.js,v  <--  handlers.js
new revision: 1.161; previous revision: 1.160
done
Checking in mozilla/extensions/irc/xul/content/prefs.js;
/cvsroot/mozilla/extensions/irc/xul/content/prefs.js,v  <--  prefs.js
new revision: 1.47; previous revision: 1.46
done
Checking in mozilla/extensions/irc/xul/content/static.js;
/cvsroot/mozilla/extensions/irc/xul/content/static.js,v  <--  static.js
new revision: 1.255; previous revision: 1.254
done
Status: ASSIGNED → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
Whiteboard: [cz-0.9.80]
(Assignee)

Updated

10 years ago
Blocks: 410974
You need to log in before you can comment on or make changes to this bug.