Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.1.14

Bug #2309 Channel list message parsing error
Submitted: 2004-09-10 11:18 UTC
From: mfdev at mftronic dot de Assigned: garrettw
Status: Closed Package: Net_SmartIRC
PHP Version: 4.3.2 OS: WinXP
Roadmaps: 1.1.4    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 5 + 23 = ?

 
 [2004-09-10 11:18 UTC] mfdev at mftronic dot de
Description: ------------ Concering Net_SmartIRC-0[1].5.5p1: I want to simply query the number of users in a channel. The relevant reply from the server however is not parsed correctly. As I'm not an IRC specialist, I do not know for sure whether it is not RFC conforming or a bug, but it's actually a big IRC network. See other fields. Reproduce code: --------------- use "example2.php" included with SmartIRC i changed server to "irc.quakenet.org" and channel to #bliesnet (but should be same with any) Expected result: ---------------- Print the number of users in the channel Actual result: -------------- Using debug mode, I get the following 3 *raw* messages as reply to 'getList': :freddyshouse.uk.quakenet.org 321 Net_SmartIRC Channel :Users Name :freddyshouse.uk.quakenet.org 322 Net_SmartIRC #bliesnet 3 : :freddyshouse.uk.quakenet.org 323 Net_SmartIRC :End of /LIST The parser however does not seem to recognize the second one, as expressed by this debug statement: DEBUG_MESSAGEPARSER: ircdata nick: "" ident: "reddyshouse.uk.quakenet.or" host: "reddyshouse.uk.quakenet.org" type: "32768" from: "freddyshouse.uk.quakenet.org" channel: "" message: "" Then it will return the third line as the result for the 'getList' method, which gives the follwing var_dump: array(2) { [0]=> bool(false) [1]=> string(12) "End of /LIST" } And obviously, I cannot extract the number of people in the channel (which is 3) from that.

Comments

 [2004-09-22 10:03 UTC] meebey
this is a normal behavoir, its currently not possible to use $data->message for channel usercount replies, you need to check $data->rawmessage, 0.5.6 will provide a method allowing ListenFor() to return the whole data object instead just the message part (which does not contain all data, like the usercount)
 [2004-12-20 15:36 UTC] meebey
as the last comment says, it's not a bug, it's by design
 [2014-10-27 10:25 UTC] garrettw (Garrett Whitehorn)
-Status: Bogus +Status: Assigned -Assigned To: +Assigned To: garrettw
This has been partially fixed. You can now get that number without having to parse a raw message -- it's already in its own variable. Look in $ircdata->params[2] when you get a message of the type SMARTIRC_TYPE_LIST. What I need to do now is make that "End of /LIST." message be discarded, since you can't really use it for anything. Raw type SMARTIRC_RPL_LISTEND is currently translated to a message type of SMARTIRC_TYPE_LIST, but I'll change it to be SMARTIRC_TYPE_NONRELEVANT.
 [2014-10-28 23:45 UTC] garrettw (Garrett Whitehorn)
-Status: Assigned +Status: Closed
On second thought, I'd better not. That could break more things than it fixes. Just sniff the $data->message content to see if it says "End of /LIST" or something.