Closed Bug 954745 Opened 11 years ago Closed 11 years ago

Show Nick: don't match nicknames contained in links and join-messages

Categories

(Instantbird Graveyard :: Demo Add-ons, defect)

x86
All
defect
Not set
minor

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 955192

People

(Reporter: aleth, Unassigned)

Details

Attachments

(1 file)

*** Original post on bio 1313 at 2012-03-03 00:03:00 UTC ***

*** Due to BzAPI limitations, the initial description is in comment 1 ***
Attached patch PatchSplinter Review
*** Original post on bio 1313 as attmnt 1216 at 2012-03-03 00:03:00 UTC ***

- Don't try to match nicks inside links.

- Don't match links in the "[username@ip] entered the room." part of join messages, so that the nick is only highlighted once (at the beginning) of each join message.

Not sure if this is generally wanted, so not requesting review...
Summary: Two edge case tweaks → Show Nick: don't match nicknames contained in links and join-messages
Comment on attachment 8352968 [details] [diff] [review]
Patch

*** Original change on bio 1313 attmnt 1216 at 2012-03-08 23:19:18 UTC ***

Adding R? as I've been using this for a while now and think it improves things.
Attachment #8352968 - Flags: review?(florian)
Comment on attachment 8352968 [details] [diff] [review]
Patch

*** Original change on bio 1313 attmnt 1216 at 2012-04-18 10:55:23 UTC ***

>--- ./shownick.js	2012-03-02 21:47:45.000000000 +0100
>+++ ./shownick.js	2012-03-02 22:24:31.000000000 +0100
>@@ -43,6 +43,11 @@
>  */
>
> Components.utils.import("resource://gre/modules/Services.jsm");
>+Components.utils.import("resource:///modules/imXPCOMUtils.jsm");
>+
>+XPCOMUtils.defineLazyGetter(this, "_", function()
>+  l10nHelper("chrome://chat/locale/irc.properties")
>+);
>
> const nickStylePref = "extensions.shownick.nickStyle";
>
>@@ -102,8 +107,12 @@
>     let self = this;
>     return (function (aNode) {
>       let result = 0;
>+      if (aNode.parentNode.localName == "a")
>+        return result;
This won't work well if there are multiple levels of elements inside the link, see [1].

>       let exp = self._getRegExp();
>       let match;
>+      let joinText = _("message.join","","");
>+      joinText = joinText.slice(joinText.indexOf("]") - joinText.length);
The nick is no longer shown twice after bug 954723 (bio 1291) was fixed.

I'm wondering if it would make more sense to only match nicks for \b<the nick>\b, and enforce a word boundary around the nicks instead of special casing these situations?

[1] http://lxr.instantbird.org/instantbird/source/chat/content/convbrowser.xml#1065
Attachment #8352968 - Flags: review?(florian) → review-
*** Original post on bio 1313 at 2013-05-30 14:26:18 UTC ***

>I'm wondering if it would make more sense to only match nicks for \b<the
>nick>\b, and enforce a word boundary around the nicks instead of special casing
>these situations?

The WIP above is seriously obsolete, as this comment shows...
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: