- case NETWORK_DIASPORA:
- if ($contact['notify']) {
- logger('queue: diaspora_delivery: item ' . $q_item['id'] . ' for ' . $contact['name'] . ' <' . $contact['url'] . '>');
- $deliver_status = Diaspora::transmit($owner, $contact, $data, $public, true, 'Queue:' . $q_item['id'], true);
-
- if ($deliver_status == (-1)) {
- QueueModel::updateTime($q_item['id']);
- Cache::set($cachekey_deadguy . $contact['notify'], true, CACHE_QUARTER_HOUR);
- } else {
- QueueModel::removeItem($q_item['id']);
- }
+
+ case Protocol::DIASPORA:
+ logger('queue: diaspora_delivery: item ' . $q_item['id'] . ' for ' . $contact['name'] . ' <' . $contact['url'] . '>');
+ $deliver_status = Diaspora::transmit($owner, $contact, $data, $public, true, 'Queue:' . $q_item['id'], true);
+
+ if ((($deliver_status >= 200) && ($deliver_status <= 299)) ||
+ ($contact['contact-type'] == Contact::ACCOUNT_TYPE_RELAY)) {
+ QueueModel::removeItem($q_item['id']);
+ } else {
+ QueueModel::updateTime($q_item['id']);
+ Cache::set($cachekey_deadguy . $contact['notify'], true, CACHE_MINUTE);