From 6e2208394a61eb4ef0893604a60de03775fe6c86 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 4 Jun 2014 16:09:34 -0700 Subject: add zrl stuff - still a lot of new stuff missing but I'm not going to do it all. --- include/bb2diaspora.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index 8d3089a29..f9ecc564f 100644 --- a/include/bb2diaspora.php +++ b/include/bb2diaspora.php @@ -281,6 +281,14 @@ function bb2diaspora($Text,$preserve_nl = false, $fordiaspora = true) { $Text = preg_replace("/\[img\](.*?)\[\/img\]/", '![' . t('image/photo') . '](' . '$1' . ')', $Text); $Text = preg_replace("/\[img\=(.*?)\](.*?)\[\/img\]/", '![' . t('image/photo') . '](' . '$2' . ')', $Text); + $Text = preg_replace("/\[zrl\]([$URLSearchString]*)\[\/zrl\]/ism", '[$1]($1)', $Text); + $Text = preg_replace("/\#\[zrl\=([$URLSearchString]*)\](.*?)\[\/zrl\]/ism", '[#$2]($1)', $Text); + $Text = preg_replace("/\[zrl\=([$URLSearchString]*)\](.*?)\[\/zrl\]/ism", '[$2]($1)', $Text); + + + $Text = preg_replace("/\[zmg\](.*?)\[\/zmg\]/", '![' . t('image/photo') . '](' . '$1' . ')', $Text); + $Text = preg_replace("/\[zmg\=(.*?)\](.*?)\[\/zmg\]/", '![' . t('image/photo') . '](' . '$2' . ')', $Text); + // Perform MAIL Search $Text = preg_replace("(\[mail\]([$MAILSearchString]*)\[/mail\])", '[$1](mailto:$1)', $Text); $Text = preg_replace("/\[mail\=([$MAILSearchString]*)\](.*?)\[\/mail\]/", '[$2](mailto:$1)', $Text); -- cgit v1.2.3 From 4fa3b420ab974be301bfe5a5861e00b4d06503b3 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 4 Jun 2014 21:02:57 -0700 Subject: duplicate birthday events showing up --- include/zot.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/zot.php b/include/zot.php index 578bdde49..9cdcbf2a4 100644 --- a/include/zot.php +++ b/include/zot.php @@ -364,6 +364,13 @@ function zot_refresh($them,$channel = null, $force = false) { if($r) { + // if the dob is the same as what we have stored (disregarding the year), keep the one + // we have as we may have updated the year after sending a notification; and resetting + // to the one we just received would cause us to create duplicated events. + + if(substr($r[0]['abook_dob'],5) == substr($next_birthday,5)) + $next_birthday = $r[0]['abook_dob']; + $current_abook_connected = (($r[0]['abook_flags'] & ABOOK_FLAG_UNCONNECTED) ? 0 : 1); $y = q("update abook set abook_their_perms = %d, abook_dob = '%s' -- cgit v1.2.3 From 8084fed8511329237c2c44b33c13d81da76a153b Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 4 Jun 2014 22:15:52 -0700 Subject: poke notifications --- include/items.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'include') diff --git a/include/items.php b/include/items.php index 1c44b7df5..c0a3a741e 100755 --- a/include/items.php +++ b/include/items.php @@ -2334,6 +2334,34 @@ function tag_deliver($uid,$item_id) { } + if (stristr($item['verb'],ACTIVITY_POKE)) { + $poke_notify = true; + + if(($item['obj_type'] == "") || ($item['obj_type'] !== ACTIVITY_OBJ_PERSON) || (! $item['object'])) + $poke_notify = false; + + $obj = json_decode_plus($item['object']); + if($obj) { + if($obj['id'] !== $u[0]['channel_hash']) + $poke_notify = false; + } + + $verb = urldecode(substr($item['verb'],strpos($item['verb'],'#')+1)); + if($poke_notify) { + require_once('include/enotify.php'); + notification(array( + 'to_xchan' => $u[0]['channel_hash'], + 'from_xchan' => $item['author_xchan'], + 'type' => NOTIFY_POKE, + 'item' => $item, + 'link' => $i[0]['llink'], + 'verb' => ACTIVITY_POKE, + 'activity' => $verb, + 'otype' => 'item' + )); + } + } + if($item['obj_type'] === ACTIVITY_OBJ_TAGTERM) { // We received a community tag activity for a post. -- cgit v1.2.3