From:  pear-qa@lists.php.net ("glen@pld-linux.org")
Date:  09 May 2018 21:19:11 Hong Kong Time
Newsgroup:  news.php.net/php.pear.bugs
Subject:  

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

NNTP-Posting-Host:  null

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:           Closed
 Type:             Feature/Change Request
 Package:          Net_SmartIRC
 Package Version:  1.1.11
 PHP Version:      Irrelevant
 Assigned To:      garrettw
 Roadmap Versions: 
 New Comment:

the return type is not technically boolean. it's 0,1,2 integers via
SMARTIRC_STATE_CONNECTED, SMARTIRC_STATE_CONNECTING,
SMARTIRC_STATE_DISCONNECTED

using the feature here: https://github.com/eventum/irc-bot/pull/10


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

[2018-05-08 20:48:27] garrettw

-Status:      Open
+Status:      Closed
-Assigned To:
+Assigned To: garrettw
Thank you for your bug report. This issue has been fixed
in the latest released version of the package, which you can download at
http://pear.php.net/get/

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

[2018-05-08 20:40:25] garrettw

Time handlers are still fired if the bot gets disconnected because you
yourself requested that feature in #20973.
I'm adding a public method isConnected() which you can call to see if
the bot is connected (returns boolean).

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

[2018-05-02 13:41:10] glen

went with "get joined channels info" to detect if should process events

https://github.com/eventum/irc-bot/pull/2

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

[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 :)

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

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://pear.php.net/bugs/bug.php?id=23746

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