*/\r
public function start($master) {\r
if (parent::start($master)) {\r
+ $this->requeue_waiting_messages();\r
$this->connect();\r
return true;\r
} else {\r
}\r
}\r
\r
+ /**\r
+ * Requeue messages from the waiting table so we try\r
+ * to send them again\r
+ *\r
+ * @return void\r
+ */\r
+ protected function requeue_waiting_messages() {\r
+ $wm = Msn_waiting_message::top($data['to']);\r
+ while ($wm != NULL) {\r
+ $this->plugin->send_message($wm->screenname, $wm->message);\r
+ $wm->delete();\r
+ $wm = Msn_waiting_message::top($data['to']);\r
+ }\r
+ }\r
+\r
/**\r
* Called by callback to log failure during connect\r
*\r
*/\r
public function handle_reconnect($data) {\r
common_log(LOG_NOTICE, 'MSN reconnecting');\r
+ // Requeue messages waiting in the DB\r
+ $this->requeue_waiting_messages();\r
}\r
\r
/**\r