Merge pull request #892 from mexon/mat/mailstream-skip-announce

[mailstream] Do not send "announce" messages
This commit is contained in:
Hypolite Petovan 2019-09-28 04:23:09 -04:00 committed by GitHub
commit bff71ce02b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -102,19 +102,28 @@ function mailstream_generate_id($a, $uri) {
function mailstream_post_hook(&$a, &$item) { function mailstream_post_hook(&$a, &$item) {
if (!PConfig::get($item['uid'], 'mailstream', 'enabled')) { if (!PConfig::get($item['uid'], 'mailstream', 'enabled')) {
Logger::debug('mailstream: not enabled for item ' . $item['id']);
return; return;
} }
if (!$item['uid']) { if (!$item['uid']) {
Logger::debug('mailstream: no uid for item ' . $item['id']);
return; return;
} }
if (!$item['contact-id']) { if (!$item['contact-id']) {
Logger::debug('mailstream: no contact-id for item ' . $item['id']);
return; return;
} }
if (!$item['uri']) { if (!$item['uri']) {
Logger::debug('mailstream: no uri for item ' . $item['id']);
return;
}
if (!$item['plink']) {
Logger::debug('mailstream: no plink for item ' . $item['id']);
return; return;
} }
if (PConfig::get($item['uid'], 'mailstream', 'nolikes')) { if (PConfig::get($item['uid'], 'mailstream', 'nolikes')) {
if ($item['verb'] == ACTIVITY_LIKE) { if ($item['verb'] == ACTIVITY_LIKE) {
Logger::debug('mailstream: like item ' . $item['id']);
return; return;
} }
} }