aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-07-19 18:53:26 -0700
committerfriendica <info@friendica.com>2012-07-19 18:53:26 -0700
commit49c0e0de9ba81883ccde15cdb2b1dc4d28f25a0a (patch)
treea355b82d15ca85a944083823ddc5f252b2e424cc /include
parent6402fa11703b094426ed99f53f04ad8e9fbbbf90 (diff)
downloadvolse-hubzilla-49c0e0de9ba81883ccde15cdb2b1dc4d28f25a0a.tar.gz
volse-hubzilla-49c0e0de9ba81883ccde15cdb2b1dc4d28f25a0a.tar.bz2
volse-hubzilla-49c0e0de9ba81883ccde15cdb2b1dc4d28f25a0a.zip
sync changes
Diffstat (limited to 'include')
-rw-r--r--include/conversation.php43
-rw-r--r--include/notifier.php24
-rw-r--r--include/text.php14
3 files changed, 64 insertions, 17 deletions
diff --git a/include/conversation.php b/include/conversation.php
index 679606933..7f3980e70 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -163,6 +163,49 @@ function localize_item(&$item){
$item['body'] = sprintf( t('%1$s is now friends with %2$s'), $A, $B)."\n\n\n".$Bphoto;
}
+ if (stristr($item['verb'],ACTIVITY_POKE)) {
+ $verb = urldecode(substr($item['verb'],strpos($item['verb'],'#')+1));
+ if(! $verb)
+ return;
+ if ($item['object-type']=="" || $item['object-type']!== ACTIVITY_OBJ_PERSON) return;
+
+ $Aname = $item['author-name'];
+ $Alink = $item['author-link'];
+
+ $xmlhead="<"."?xml version='1.0' encoding='UTF-8' ?".">";
+
+ $obj = parse_xml_string($xmlhead.$item['object']);
+ $links = parse_xml_string($xmlhead."<links>".unxmlify($obj->link)."</links>");
+
+ $Bname = $obj->title;
+ $Blink = ""; $Bphoto = "";
+ foreach ($links->link as $l){
+ $atts = $l->attributes();
+ switch($atts['rel']){
+ case "alternate": $Blink = $atts['href'];
+ case "photo": $Bphoto = $atts['href'];
+ }
+
+ }
+
+ $A = '[url=' . zrl($Alink) . ']' . $Aname . '[/url]';
+ $B = '[url=' . zrl($Blink) . ']' . $Bname . '[/url]';
+ if ($Bphoto!="") $Bphoto = '[url=' . zrl($Blink) . '][img=80x80]' . $Bphoto . '[/img][/url]';
+
+ // we can't have a translation string with three positions but no distinguishable text
+ // So here is the translate string.
+
+ $txt = t('%1$s poked %2$s');
+
+ // now translate the verb
+
+ $txt = str_replace( t('poked'), t($verb), $txt);
+
+ // then do the sprintf on the translation string
+
+ $item['body'] = sprintf($txt, $A, $B). "\n\n\n" . $Bphoto;
+
+ }
if ($item['verb']===ACTIVITY_TAG){
$r = q("SELECT * from `item`,`contact` WHERE
`item`.`contact-id`=`contact`.`id` AND `item`.`uri`='%s';",
diff --git a/include/notifier.php b/include/notifier.php
index f443c700a..d67f2dd3a 100644
--- a/include/notifier.php
+++ b/include/notifier.php
@@ -180,6 +180,8 @@ function notifier_run($argv, $argc){
$parent = $items[0];
+
+
// This is IMPORTANT!!!!
// We will only send a "notify owner to relay" or followup message if the referenced post
@@ -195,10 +197,9 @@ function notifier_run($argv, $argc){
// Other DFRN conversation members will be alerted during polled updates.
-
- $localhost = str_replace('www.','',$a->get_hostname());
- if(strpos($localhost,':'))
- $localhost = substr($localhost,0,strpos($localhost,':'));
+ $relay_to_owner = false;
+
+ $relay_origin_check = (((intval($target_item['origin'])) && (! intval($parent['origin']))) ? true : false);
/**
*
@@ -208,28 +209,17 @@ function notifier_run($argv, $argc){
*
*/
- $relay_to_owner = false;
- if((! $top_level) && ($parent['wall'] == 0) && (! $expire) && (stristr($target_item['uri'],$localhost))) {
+ if((! $top_level) && ($parent['wall'] == 0) && ($relay_origin_check) && (! $expire))
$relay_to_owner = true;
- }
-
if(($cmd === 'uplink') && (intval($parent['forum_mode']) == 1) && (! $top_level)) {
$relay_to_owner = true;
}
- // until the 'origin' flag has been in use for several months
- // we will just use it as a fallback test
- // later we will be able to use it as the primary test of whether or not to relay.
-
- if(! $target_item['origin'])
+ if(! $relay_origin_check)
$relay_to_owner = false;
- if($parent['origin'])
- $relay_to_owner = false;
-
-
if($relay_to_owner) {
logger('notifier: followup', LOGGER_DEBUG);
diff --git a/include/text.php b/include/text.php
index fe36e1319..05fcad6be 100644
--- a/include/text.php
+++ b/include/text.php
@@ -705,6 +705,20 @@ function linkify($s) {
return($s);
}}
+function get_poke_verbs() {
+
+ // index is present tense verb
+ // value is array containing past tense verb, translation of present, translation of past
+
+ $arr = array(
+ 'poke' => array( 'poked', t('poke'), t('poked')),
+ 'prod' => array( 'prodded', t('prod'), t('prodded')),
+ 'slap' => array( 'slapped', t('slap'), t('slapped')),
+ 'finger' => array( 'fingered', t('finger'), t('fingered'))
+ );
+ call_hooks('poke_verbs', $arr);
+ return $arr;
+}
/**
*