From 0ec25679d07cb4bb496ea859d152ed5b28b88c66 Mon Sep 17 00:00:00 2001 From: Gergely POLONKAI Date: Sun, 7 Oct 2012 01:49:25 +0200 Subject: [PATCH] Added the send command --- Service/Sender.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Service/Sender.php b/Service/Sender.php index 3256267..fddf130 100644 --- a/Service/Sender.php +++ b/Service/Sender.php @@ -36,16 +36,24 @@ class Sender public function login($username, $password) { - var_dump($this->sender->login($username, $password)); + if ($this->sender->login($username, $password) === true) { + $this->loggedIn = true; + } } public function sendMessage($recipient, $message, array $passwordLocations) { - var_dump($this->sender->sendMessage($recipient, $message, $passwordLocations)); + if (!$this->loggedIn) { + return false; + } + $this->sender->sendMessage($recipient, $message, $passwordLocations); } public function logout() { - var_dump($this->sender->logout()); + if (!$this->loggedIn) { + return false; + } + $this->sender->logout(); } }