From 2856042824b57230a1b66806d6008842306116a4 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 31 May 2015 10:38:00 +0200 Subject: [PATCH 1/2] Send a hubsub notification for every comment --- include/items.php | 3 ++- include/notifier.php | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/items.php b/include/items.php index 2c4ae9e5c..87a7daea0 100644 --- a/include/items.php +++ b/include/items.php @@ -118,7 +118,8 @@ function get_feed_for(&$a, $dfrn_id, $owner_nick, $last_update, $direction = 0, // Include answers to status.net posts in pubsub feeds if($forpubsub) { $sql_post_table = "INNER JOIN `thread` ON `thread`.`iid` = `item`.`parent` "; - $visibility = "OR (`item`.`network` = 'dfrn' AND `thread`.`network`='stat')"; + $visibility = sprintf("OR (`item`.`network` = '%s' AND `thread`.`network`='%s')", + dbesc(NETWORK_DFRN), dbesc(NETWORK_OSTATUS)); $date_field = "`received`"; $sql_order = "`item`.`received` DESC"; } else { diff --git a/include/notifier.php b/include/notifier.php index 318e0eab2..dc4e1a239 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -295,13 +295,18 @@ function notifier_run(&$argv, &$argc){ $conversant_str = dbesc($parent['contact-id']); $recipients = array($parent['contact-id']); + if (!$item['private'] AND $item['wall'] AND + (strlen($item['allow_cid'].$item['allow_gid']. + $item['deny_cid'].$item['deny_gid']) == 0)) + $push_notify = true; + if ($parent['network'] == NETWORK_OSTATUS) { logger('Parent is OStatus', LOGGER_DEBUG); $push_notify = true; // Check if the recipient isn't in your contact list, try to slap it - // This doesn't seem to work correctly by now + // Not sure if it is working or not. $r = q("SELECT `url` FROM `contact` WHERE `id` = %d", $parent['contact-id']); if (count($r)) { $url_recipients = array(); From fae3592c7907eeee41904266124ff97046f3dcb9 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 31 May 2015 13:28:16 +0200 Subject: [PATCH 2/2] Bugfix: You wasn't able to add an OStatus contact when you are following the same contact via Statusnet connector. --- mod/follow.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mod/follow.php b/mod/follow.php index b9401ee82..95f95d024 100755 --- a/mod/follow.php +++ b/mod/follow.php @@ -14,8 +14,11 @@ function follow_content(&$a) { $uid = local_user(); $url = notags(trim($_REQUEST['url'])); - $r = q("SELECT `url` FROM `contact` WHERE `uid` = %d AND (`nurl` = '%s' OR `alias` = '%s' OR `alias` = '%s') LIMIT 1", - intval(local_user()), dbesc(normalise_link($url)), dbesc(normalise_link($url)), dbesc($url)); + $r = q("SELECT `url` FROM `contact` WHERE `uid` = %d AND + (`nurl` = '%s' OR `alias` = '%s' OR `alias` = '%s') AND + `network` != '%s' LIMIT 1", + intval(local_user()), dbesc(normalise_link($url)), + dbesc(normalise_link($url)), dbesc($url), dbesc(NETWORK_STATUSNET)); if ($r) { notice(t('You already added this contact.').EOL);