Closed Bug 1182735 Opened 9 years ago Closed 9 years ago

irc.oftc.net sends NOTICE before connection

Categories

(Instantbird Graveyard :: Other, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Instantbird 42

People

(Reporter: arlolra, Assigned: clokep)

References

Details

Attachments

(2 files, 1 obsolete file)

Attached patch oftc.patchSplinter Review
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.132 Safari/537.36

Steps to reproduce:

Doesn't respect account._showServerTab
Attachment #8632395 - Attachment is patch: true
Attachment #8632395 - Attachment mime type: text/x-patch → text/plain
Attachment #8632395 - Flags: review?(clokep)
Comment on attachment 8632395 [details] [diff] [review]
oftc.patch

Review of attachment 8632395 [details] [diff] [review]:
-----------------------------------------------------------------

::: chat/protocols/irc/ircNonStandard.jsm
@@ +45,5 @@
>        // directions to users.
> +      if (!this.connected && !isAuth &&
> +        // But irc.oftc.net's isn't that helpful.
> +        !(!this.imAccount._showServerTab &&
> +          aMessage.params[1].startsWith("*** Connected securely via"))

Maybe the starts with is unnecessary or a check like (aMessage.params[1].startsWith("***")) is better?
Comment on attachment 8632395 [details] [diff] [review]
oftc.patch

Review of attachment 8632395 [details] [diff] [review]:
-----------------------------------------------------------------

I need to see the *exact* wire message sent before reviewing this.

I'd love to see tests for this code, by the way. It very much scares me all the hacks around it.

::: chat/protocols/irc/ircNonStandard.jsm
@@ +44,5 @@
>        // Some servers , e.g. irc.umich.edu, use NOTICE before connection to give
>        // directions to users.
> +      if (!this.connected && !isAuth &&
> +        // But irc.oftc.net's isn't that helpful.
> +        !(!this.imAccount._showServerTab &&

Does this._showServerTab not work? I'm skeptical of checking this flag here.
Attachment #8632395 - Flags: review?(clokep) → review-
The exact wire message is,

{"rawMessage":":beauty.oftc.net NOTICE myusername :*** Connected securely via UNKNOWN AES128-SHA-128","command":"NOTICE","params":["myusername","*** Connected securely via UNKNOWN AES128-SHA-128"],"origin":"beauty.oftc.net","tags":{},"source":""}

and this arrives before 001.
Depends on: 1184406
Attached patch Patch v2 (obsolete) — Splinter Review
Instead of adding more hacks onto that NOTICE handler, I rewrote it to be clearer about what we expect. This does slightly change behavior (see the changes to the tests), but overall I think is more consistent.
Assignee: nobody → clokep
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attachment #8637082 - Flags: review?(aleth)
Oops, I attached the wrong patch last time!
Attachment #8637082 - Attachment is obsolete: true
Attachment #8637082 - Flags: review?(aleth)
Attachment #8637308 - Flags: review?(aleth)
Comment on attachment 8637308 [details] [diff] [review]
Patch v2 for real

Review of attachment 8637308 [details] [diff] [review]:
-----------------------------------------------------------------

Looks like a good improvement! r+ with comments fixed/added.

::: chat/protocols/irc/ircNonStandard.jsm
@@ -33,5 @@
> -      // user. Generally AUTH messages start with ***, but this could pretty
> -      // easily be faked.
> -      // Freenode simply sends * for the target. Moznet sends Auth (used to send
> -      // AUTH); in this case, check if the user's nickname is not auth, or the
> -      // the message starts with ***.

Some of this useful comment seems to have gone missing.

::: chat/protocols/irc/test/test_ircNonStandard.js
@@ +108,5 @@
>    do_check_true(account.shouldAuthenticate === false);
>  
>    // Finally, check if the message is wrong.
>    account = new FakeAccount("password");
> +  message.params[1] = "Test";

Why are we setting this param? A comment would be nice.
Attachment #8637308 - Flags: review?(aleth) → review+
This includes an updated comment that aleth reviewed in person.

https://hg.mozilla.org/comm-central/rev/1072781ba002
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.6
Updating milestone from 1.6 to 42.
Target Milestone: 1.6 → Instantbird 42
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: