aboutsummaryrefslogtreecommitdiffstats
path: root/include/conversation.php
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/conversation.php
parent6402fa11703b094426ed99f53f04ad8e9fbbbf90 (diff)
downloadvolse-hubzilla-49c0e0de9ba81883ccde15cdb2b1dc4d28f25a0a.tar.gz
volse-hubzilla-49c0e0de9ba81883ccde15cdb2b1dc4d28f25a0a.tar.bz2
volse-hubzilla-49c0e0de9ba81883ccde15cdb2b1dc4d28f25a0a.zip
sync changes
Diffstat (limited to 'include/conversation.php')
-rw-r--r--include/conversation.php43
1 files changed, 43 insertions, 0 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';",