Skip to content

Commit

Permalink
Fix pushing to own channels. Closes #46
Browse files Browse the repository at this point in the history
Fixed a bug (#46) that prevented users from pushing to their own channels if they are subscribed to them.
  • Loading branch information
ivkos committed May 23, 2015
1 parent 04bcc9d commit cfde6d9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Pushbullet/Pushbullet.php
Expand Up @@ -263,12 +263,6 @@ public function channel($tag)
$this->getMyChannels();
}

foreach ($this->channels as $c) {
if ($tag == $c->channel->tag) {
return $c;
}
}

foreach ($this->myChannels as $c) {
if ($tag == $c->tag) {
$c->myChannel = true;
Expand All @@ -277,6 +271,12 @@ public function channel($tag)
}
}

foreach ($this->channels as $c) {
if ($tag == $c->channel->tag) {
return $c;
}
}

return new Channel(["tag" => $tag], $this->apiKey);
}

Expand Down

0 comments on commit cfde6d9

Please sign in to comment.