Add ability to change default quit message on ChatZilla

RESOLVED FIXED

Status

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

People

(Reporter: David Eccles, Assigned: Gijs)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [cz-0.9.69][cz-0.9.69.2])

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

12 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6

I have noticed that there does not appear to be any functionality for changing
the default reason for quitting ChatZilla. I didn't notice any obvious
preferences in the program for this functionality, so had a quick browse through
the source code  (chatzilla-0.9.68.5) to confirm this. I noticed that the
cmdQuit(e) function in content\chatzilla\commands.js appears to only spit out
the userAgent string if a reason is not given (found around line 1417 of
command.js). It would be nice if this quit message could be customised by a user
preference, so that people can change their message to say something other than,
 "I decided to quit because I used 'Chatzilla 0.9.68a [Firefox 1.0.6/20050716]'.

Reproducible: Always

Steps to Reproduce:
1. type "/quit" [with no reason] from within ChatZilla

Actual Results:  
Displays a quit message, with the client.userAgent as a reason for quitting.

Expected Results:  
Display a custom quit message (most likely defaulting to the userAgent string)
when no reason is given.

I'm not familiar at all with the preference collections etc., so I'm putting
this in as a suggestion rather than a patch.

Current code from chatzilla-0.9.68.5 (content\chatzilla\commands.js:1417):
function cmdQuit(e)
{
    if (!e.reason)
        e.reason = client.userAgent;
    client.quit(e.reason);
    window.close();
}

Proposed new code:
function cmdQuit(e)
{
    if (!e.reason)
    {
        if (!client.prefs["quitMessage"])
             e.reason = client.userAgent;
        else
             e.reason = client.prefs["quitMessage"];
    }
    client.quit(e.reason);
    window.close();
}

Comment 1

12 years ago
I've got this ready in 0.9.68.6 already. :)
Assignee: rginda → silver
Status: UNCONFIRMED → NEW
Ever confirmed: true
Hardware: PC → All
Whiteboard: [cz-need-patch][cz-0.9.68.6]
Version: unspecified → Trunk

Updated

12 years ago
Status: NEW → ASSIGNED

Comment 2

12 years ago
Created attachment 193377 [details] [diff] [review]
[checked-in] Add default quit msg preference
Attachment #193377 - Flags: review?(samuel)

Updated

12 years ago
Whiteboard: [cz-need-patch][cz-0.9.68.6] → [cz-patch][cz-0.9.68.6]

Comment 3

12 years ago
Comment on attachment 193377 [details] [diff] [review]
[checked-in] Add default quit msg preference

Might be nice to be able to specify it per network though.
Attachment #193377 - Flags: review?(samuel) → review+

Updated

12 years ago
Blocks: 299458

Comment 4

12 years ago
Comment on attachment 193377 [details] [diff] [review]
[checked-in] Add default quit msg preference

Checked in. Leaving bug open for per-network update.
Attachment #193377 - Attachment description: Add default quit msg preference → [checked-in] Add default quit msg preference
Attachment #193377 - Attachment is obsolete: true

Updated

12 years ago
Whiteboard: [cz-patch][cz-0.9.68.6] → [cz-0.9.68.6]
(Assignee)

Comment 5

12 years ago
Created attachment 205950 [details] [diff] [review]
Patch for a network-specific message

I've moved the client quit message as well, to keep them in the same place (as there's no Global tab for networks).

So, this modifies client.quit and the disconnecting commands to use the network pref. As this defers to the client pref, everything works as expected (as far as I can tell).
Attachment #205950 - Flags: review?(samuel)
(Assignee)

Updated

12 years ago
Assignee: silver → gijskruitbosch+bugs
Status: ASSIGNED → NEW
(Assignee)

Updated

12 years ago
Status: NEW → ASSIGNED

Updated

12 years ago
Attachment #205950 - Flags: review?(samuel) → review+

Comment 6

12 years ago
Checked in --> FIXED.
Status: ASSIGNED → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → FIXED

Updated

12 years ago
Whiteboard: [cz-0.9.68.6] → [cz-0.9.69]

Updated

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