Req #23746 [Com]: time handlers: need to know online state

From: Date: Wed, 02 May 2018 17:41:10 +0000
Subject: Req #23746 [Com]: time handlers: need to know online state
References: 1  Groups: php.pear.bugs 
Request: Send a blank email to pear-bugs+get-11423@lists.php.net to get a copy of this message
Edit report at https://pear.php.net/bugs/bug.php?id=23746&edit=1 ID: 23746 Comment by: glen at pld-linux dot org Reported By: glen at pld-linux dot org Summary: time handlers: need to know online state Status: Open Type: Feature/Change Request Package: Net_SmartIRC Package Version: 1.1.11 PHP Version: Irrelevant Roadmap Versions: New Comment: went with "get joined channels info" to detect if should process events https://github.com/eventum/irc-bot/pull/2 Previous Comments: ------------------------------------------------------------------------ [2018-05-01 15:50:57] glen some other idea was to listen to connect, disconnect events, and update local state somehow. but there are imho too many codes to follow, and still get it wrong with some other type of irc server (or irc server with bugs) ------------------------------------------------------------------------ [2018-05-01 15:09:42] glen on second thought, i should be able to access $target via $irc->getChannel for channels, but doesn't work for users as users don't need to be in any channel to be online. but then again, i can just skip all actions if bot is not in any channels, which means it's likely disconnected. but still would like to hear more ideas or feedback to mine :) ------------------------------------------------------------------------ [2018-05-01 15:04:44] glen Description: ------------ i have time handlers that take data from external system and submit to irc channel. how if bot gets disconnected, the time handlers are still fired. and there does not seem to be a way to obtain connection state $irc->_updatestate() exists, but it's protected, not accessible from outside. otherwise the $irc object is available from callback, so making $irc->getState or $irc->getLoggedIn public would solve my problem. as it's probably too breaking change to stop emitting timer events if disconnected, so that solution won't do much. ------------------------------------------------------------------------ -- Edit this bug report at https://pear.php.net/bugs/bug.php?id=23746&edit=1

« previous php.pear.bugs (#11423) next »