From:  garrettw87@gmail.com
Date:  30 Dec 2014 18:39:44 Hong Kong Time
Newsgroup:  news.php.net/php.pear.bugs
Subject:  

[PEAR-BUG] Bug #20476 [Opn]: 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:           Open
 Type:             Bug
 Package:          Net_SmartIRC
 Operating System: Mac OSX Yosemite
 Package Version:  1.1.5
 PHP Version:      5.6.4
 Roadmap Versions: 
 New Comment:

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?


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

[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