From:  garrettw87@gmail.com
Date:  08 Jan 2015 10:13:17 Hong Kong Time
Newsgroup:  news.php.net/php.pear.bugs
Subject:  

[PEAR-BUG] Bug #20476 [Asn->Csd]: JOIN not correct

NNTP-Posting-Host:  null

Edit report at https://pear.php.net/bugs/bug.php?id=20476&edit=1

 ID:               20476
 Updated by:       garrettw87@gmail.com
 Reported By:      sem dot schilder at gmail dot com
 Summary:          JOIN not correct
-Status:           Assigned
+Status:           Closed
 Type:             Bug
 Package:          Net_SmartIRC
 Operating System: Mac OSX Yosemite
 Package Version:  1.1.5
 PHP Version:      5.6.4
 Assigned To:      garrettw
 Roadmap Versions: 
 New Comment:

-Status: Assigned
+Status: Closed
This bug has been fixed in SVN.

If this was a documentation problem, the fix will appear on pear.php.net
by the end of next Sunday (CET).

If this was a problem with the pear.php.net website, the change should
be live shortly.

Otherwise, the fix will appear in the package's next release.

Thank you for the report and for helping us make PEAR better.




Previous Comments:
------------------------------------------------------------------------

[2014-12-30 10:55:39] garrettw

-Status:      Open
+Status:      Assigned
-Assigned To:
+Assigned To: garrettw
Nevermind ��I've found evidence elsewhere online that suggests adding
the extra colon may be common practice for some IRCds, so I think it
would be wise for me to add a workaround into the code to compensate for
those non-standards-compliant servers. Piece of cake.

------------------------------------------------------------------------

[2014-12-30 10:39:43] garrettw

That is strange. 
If I'm reading RFC2812 correctly, the JOIN message you should receive
when another user joins your channel consists of:
: JOIN <#channel>

...but yours has an extra colon in there, which is throwing the bot
off:
: JOIN :<#channel>

In what situation is this occurring? Is this received right after the
bot joins a channel, or is this when some other user joins, or what?

------------------------------------------------------------------------

[2014-12-29 23:24:22] xvilo

Description:
------------
When a user joins the channel, the $data variable is not correct, 
the $data->channel is empty and the actual channel is in $data-
>message... 

Test script:
---------------
//action handler
$irc->registerActionHandler(SMARTIRC_TYPE_JOIN, '.*?', $this,
'irc_join'),

//function
public function irc_karma($irc, $data){
    var_dump($data);
}

Expected result:
----------------
object(Net_SmartIRC_data)#20 (11) {
  ["from"]=>
  string(25) "xvilo!xvilo@internet.user"
  ["nick"]=>
  string(5) "xvilo"
  ["ident"]=>
  string(5) "xvilo"
  ["host"]=>
  string(13) "internet.user"
  ["channel"]=>
  string(4) "#DPF"
  ["params"]=>
  array(0) {
  }
  ["message"]=>
  NULL
  ["messageex"]=>
  array(1) {
    [0]=>
    NULL
  }
  ["type"]=>
  int(64)
  ["rawmessage"]=>
  string(37) ":xvilo!xvilo@internet.user JOIN :#DPF"
  ["rawmessageex"]=>
  array(3) {
    [0]=>
    string(26) ":xvilo!xvilo@internet.user"
    [1]=>
    string(4) "JOIN"
    [2]=>
    string(5) ":#DPF"
  }
}

Actual result:
--------------
object(Net_SmartIRC_data)#20 (11) {
  ["from"]=>
  string(25) "xvilo!xvilo@internet.user"
  ["nick"]=>
  string(5) "xvilo"
  ["ident"]=>
  string(5) "xvilo"
  ["host"]=>
  string(13) "internet.user"
  ["channel"]=>
  NULL
  ["params"]=>
  array(0) {
  }
  ["message"]=>
  string(4) "#DPF"
  ["messageex"]=>
  array(1) {
    [0]=>
    string(4) "#DPF"
  }
  ["type"]=>
  int(64)
  ["rawmessage"]=>
  string(37) ":xvilo!xvilo@internet.user JOIN :#DPF"
  ["rawmessageex"]=>
  array(3) {
    [0]=>
    string(26) ":xvilo!xvilo@internet.user"
    [1]=>
    string(4) "JOIN"
    [2]=>
    string(5) ":#DPF"
  }
}

------------------------------------------------------------------------


-- 
Edit this bug report at https://pear.php.net/bugs/bug.php?id=20476&edit=1