From 2e327dfcd7ea079dbd0855ce0f53e51197cc1f6b Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Mon, 28 Mar 2016 11:33:52 +0200 Subject: [PATCH] Probably fixes issue with looping XMPP queue items --- plugins/Xmpp/XmppPlugin.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/plugins/Xmpp/XmppPlugin.php b/plugins/Xmpp/XmppPlugin.php index f8476cd8f2..da20504329 100644 --- a/plugins/Xmpp/XmppPlugin.php +++ b/plugins/Xmpp/XmppPlugin.php @@ -315,9 +315,13 @@ class XmppPlugin extends ImPlugin function sendNotice($screenname, Notice $notice) { - $msg = $this->formatNotice($notice); - $entry = $this->format_entry($notice); - + try { + $msg = $this->formatNotice($notice); + $entry = $this->format_entry($notice); + } catch (Exception $e) { + common_log(LOG_ERR, __METHOD__ . ": Discarding outgoing stanza because of exception: {$e->getMessage()}"); + return false; // return value of sendNotice is never actually used as of now + } $this->queuedConnection()->message($screenname, $msg, 'chat', null, $entry); return true; }