Closed Bug 342640 Opened 20 years ago Closed 19 years ago

Doing a multiline paste makes analys of logs impossible.

Categories

(Other Applications Graveyard :: ChatZilla, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: azoff, Assigned: Gijs)

Details

(Whiteboard: [cz-0.9.76])

Attachments

(1 file)

3.51 KB, patch
bugzilla-mozilla-20000923
: review+
Details | Diff | Splinter Review
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.4) Gecko/20060611 Firefox/1.5.0.4 Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.4) Gecko/20060611 Firefox/1.5.0.4 If you paste a multiline string inside chatzilla, the string will end up being displayed over some lines (\n is beeing converted to a real new line). This also ends up geting into the logfile (if you use it). As I am a developer of PISG (http://pisg.sf.net), an analys tool for irc logs, I think this format is somewhat broken as all other clients I have looked at does create multiplie timestamps (one for each row) whereas chatzilla just creates one for the first line. Reproducible: Always Steps to Reproduce: 1. Just paste a multiline string, for example "this is line 1\nthis is line 2\nthis is line 3" Actual Results: something like: [HH:mm] <nick> this is line 1 this is line 2 this is line 3 Expected Results: something like: [HH:mm] <nick> this is line 1 [HH:mm] <nick> this is line 2 [HH:mm] <nick> this is line 3
Attached patch PatchSplinter Review
Split the logstring in its prefix and an array of message parts, put together again when we're logging.
Assignee: rginda → gijskruitbosch+bugs
Status: UNCONFIRMED → ASSIGNED
Attachment #244717 - Flags: review?(samuel)
Comment on attachment 244717 [details] [diff] [review] Patch > if (typeof message == "string") > { > msgRowData.appendChild(stringToMsg(message, this)); >- logString += message; >+ var tmpMsgs = message.split(/\r?\n/); >+ for (var l = 0; l < tmpMsgs.length; l++) >+ logStrings[l] = logStringPfx + tmpMsgs[l]; > } > else > { > msgRowData.appendChild(message); >- logString += message.innerHTML.replace(/<[^<]*>/g, ""); >+ var tmpMsgs = message.innerHTML.replace(/<[^<]*>/g, "") >+ tmpMsgs = tmpMsgs.split(/\r?\n/); >+ for (var l = 0; l < tmpMsgs.length; l++) >+ logStrings[l] = logStringPfx + tmpMsgs[l]; > } These two could be factored out, no? Not sure it'd be shorted, actually, but it would mean only one loop. >- this.logFile.write(fromUnicode(logString + client.lineEnd, "utf-8")); >+ for (var l = 0; l < logStrings.length; l++) >+ this.logFile.write(fromUnicode(logStrings[l] + client.lineEnd, "utf-8")); This line is too long. :( Could do: var LE = client.lineEnd; Then use LE in the loop. Faster and shorter line! r=silver with those fixed.
Attachment #244717 - Flags: review?(samuel) → review+
Fixed nits; Checking in mozilla/extensions/irc/xul/content/static.js; /cvsroot/mozilla/extensions/irc/xul/content/static.js,v <-- static.js new revision: 1.214; previous revision: 1.213 done
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Whiteboard: [cz-0.9.76]
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: