From aa1429ec71bbac72f88e1e7c485b16cefecef762 Mon Sep 17 00:00:00 2001 From: Grag Atrim Date: Thu, 23 Jun 2016 07:08:51 -0400 Subject: [PATCH] Fixed Illegal string offset due to (un)archiving channels The payload that is sent over from slack when you (un)archive a channel collapses the "channel" sub-array to just be a string containing the ID of the channel. That resulted in an Illegal string offset error being thrown if the bot was in a channel that was archived or unarchived. --- src/RealTimeClient.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/RealTimeClient.php b/src/RealTimeClient.php index 8cb402b..3af3163 100644 --- a/src/RealTimeClient.php +++ b/src/RealTimeClient.php @@ -398,11 +398,11 @@ private function onMessage(WebSocketMessageInterface $message) break; case 'channel_archive': - $this->channels[$payload['channel']['id']]->data['is_archived'] = true; + $this->channels[$payload['channel']]->data['is_archived'] = true; break; case 'channel_unarchive': - $this->channels[$payload['channel']['id']]->data['is_archived'] = false; + $this->channels[$payload['channel']]->data['is_archived'] = false; break; case 'group_joined':