]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/OStatus/classes/Ostatus_profile.php
Merge remote-tracking branch 'upstream/master'
[quix0rs-gnu-social.git] / plugins / OStatus / classes / Ostatus_profile.php
index 9d41b6727341d41eaa31949f574bd1b2c6cd47c4..07432d78fa1c4d65a3134973bcc948ec7a84e38c 100644 (file)
@@ -377,14 +377,19 @@ class Ostatus_profile extends Managed_DataObject
     public function notifyDeferred($entry, Profile $actor)
     {
         if ($this->salmonuri) {
-            common_debug("OSTATUS: user {$actor->getNickname()} ({$actor->getID()}) wants to ping {$this->localProfile()->getNickname()} on {$this->salmonuri}");
-            $data = array('salmonuri' => $this->salmonuri,
-                          'entry' => $this->notifyPrepXml($entry),
-                          'actor' => $actor->getID(),
-                          'target' => $this->localProfile()->getID());
-
-            $qm = QueueManager::get();
-            return $qm->enqueue($data, 'salmon');
+            try {
+                common_debug("OSTATUS: user {$actor->getNickname()} ({$actor->getID()}) wants to ping {$this->localProfile()->getNickname()} on {$this->salmonuri}");
+                $data = array('salmonuri' => $this->salmonuri,
+                              'entry' => $this->notifyPrepXml($entry),
+                              'actor' => $actor->getID(),
+                              'target' => $this->localProfile()->getID());
+
+                $qm = QueueManager::get();
+                return $qm->enqueue($data, 'salmon');
+            } catch (Exception $e) {
+                common_log(LOG_ERR, 'OSTATUS: Something went wrong when creating a Salmon slap: '._ve($e->getMessage()));
+                return false;
+            }
         }
 
         return false;