OStatus sub/unsub updates:

- fix for PuSH unsub verification
- send Salmon notification on unsub
This commit is contained in:
Brion Vibber
2010-02-18 18:20:48 +00:00
parent c2ba764535
commit 22ff358ba8
11 changed files with 108 additions and 48 deletions

View File

@@ -303,6 +303,12 @@ class ActivityVerb
const FRIEND = 'http://activitystrea.ms/schema/1.0/make-friend';
const JOIN = 'http://activitystrea.ms/schema/1.0/join';
const TAG = 'http://activitystrea.ms/schema/1.0/tag';
// Custom OStatus verbs for the flipside until they're standardized
const DELETE = 'http://ostatus.org/schema/1.0/unfollow';
const UNFAVORITE = 'http://ostatus.org/schema/1.0/unfavorite';
const UNFOLLOW = 'http://ostatus.org/schema/1.0/unfollow';
const LEAVE = 'http://ostatus.org/schema/1.0/leave';
}
/**

View File

@@ -33,13 +33,14 @@ class HubVerifyQueueHandler extends QueueHandler
{
$sub = $data['sub'];
$mode = $data['mode'];
$token = $data['token'];
assert($sub instanceof HubSub);
assert($mode === 'subscribe' || $mode === 'unsubscribe');
common_log(LOG_INFO, __METHOD__ . ": $mode $sub->callback $sub->topic");
try {
$sub->verify($mode);
$sub->verify($mode, $token);
} catch (Exception $e) {
common_log(LOG_ERR, "Failed PuSH $mode verify to $sub->callback for $sub->topic: " .
$e->getMessage());