aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rwxr-xr-xinclude/acl_selectors.php14
-rwxr-xr-xinclude/conversation.php11
-rwxr-xr-xinclude/diaspora.php42
-rwxr-xr-xinclude/items.php1
-rw-r--r--include/text.php2
5 files changed, 63 insertions, 7 deletions
diff --git a/include/acl_selectors.php b/include/acl_selectors.php
index 67d8cebde..a5f5aff53 100755
--- a/include/acl_selectors.php
+++ b/include/acl_selectors.php
@@ -113,11 +113,13 @@ function contact_selector($selname, $selclass, $preselected = false, $options) {
$str_nets = implode(',',$x['networks']);
$sql_extra .= " AND `network` IN ( $str_nets ) ";
}
+
+ $tabindex = (x($options, 'tabindex') ? "tabindex=\"" . $options["tabindex"] . "\"" : "");
if($x['single'])
- $o .= "<select name=\"$selname\" id=\"$selclass\" class=\"$selclass\" size=\"" . $x['size'] . "\" >\r\n";
+ $o .= "<select name=\"$selname\" id=\"$selclass\" class=\"$selclass\" size=\"" . $x['size'] . "\" $tabindex >\r\n";
else
- $o .= "<select name=\"{$selname}[]\" id=\"$selclass\" class=\"$selclass\" multiple=\"multiple\" size=\"" . $x['size'] . "$\" >\r\n";
+ $o .= "<select name=\"{$selname}[]\" id=\"$selclass\" class=\"$selclass\" multiple=\"multiple\" size=\"" . $x['size'] . "$\" $tabindex >\r\n";
$r = q("SELECT `id`, `name`, `url`, `network` FROM `contact`
WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 AND `pending` = 0 AND `notify` != ''
@@ -156,7 +158,7 @@ function contact_selector($selname, $selclass, $preselected = false, $options) {
-function contact_select($selname, $selclass, $preselected = false, $size = 4, $privmail = false, $celeb = false, $privatenet = false) {
+function contact_select($selname, $selclass, $preselected = false, $size = 4, $privmail = false, $celeb = false, $privatenet = false, $tabindex = null) {
$a = get_app();
@@ -178,12 +180,12 @@ function contact_select($selname, $selclass, $preselected = false, $size = 4, $p
$sql_extra .= " AND `network` IN ( 'dfrn', 'mail', 'face', 'dspr' ) ";
}
-
+ $tabindex = ($tabindex > 0 ? "tabindex=\"$tabindex\"" : "");
if($privmail)
- $o .= "<select name=\"$selname\" id=\"$selclass\" class=\"$selclass\" size=\"$size\" >\r\n";
+ $o .= "<select name=\"$selname\" id=\"$selclass\" class=\"$selclass\" size=\"$size\" $tabindex >\r\n";
else
- $o .= "<select name=\"{$selname}[]\" id=\"$selclass\" class=\"$selclass\" multiple=\"multiple\" size=\"$size\" >\r\n";
+ $o .= "<select name=\"{$selname}[]\" id=\"$selclass\" class=\"$selclass\" multiple=\"multiple\" size=\"$size\" $tabindex >\r\n";
$r = q("SELECT `id`, `name`, `url`, `network` FROM `contact`
WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 AND `pending` = 0 AND `notify` != ''
diff --git a/include/conversation.php b/include/conversation.php
index 88ecf502b..8ca484c9e 100755
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -779,6 +779,17 @@ function item_photo_menu($item){
if(($cid) && (! $item['self'])) {
$contact_url = $a->get_baseurl($ssl_state) . '/contacts/' . $cid;
$posts_link = $a->get_baseurl($ssl_state) . '/network/?cid=' . $cid;
+
+ $clean_url = normalise_link($item['author-link']);
+
+ if((local_user()) && (local_user() == $item['uid'])) {
+ if(isset($a->contacts) && x($a->contacts,$clean_url)) {
+ if($a->contacts[$clean_url]['network'] === NETWORK_DIASPORA) {
+ $pm_url = $a->get_baseurl($ssl_state) . '/message/new/' . $cid;
+ }
+ }
+ }
+
}
$menu = Array(
diff --git a/include/diaspora.php b/include/diaspora.php
index dca857a19..1b5af42cd 100755
--- a/include/diaspora.php
+++ b/include/diaspora.php
@@ -1159,6 +1159,48 @@ function diaspora_comment($importer,$xml,$msg) {
proc_run('php','include/notifier.php','comment',$message_id);
}
+
+ $myconv = q("SELECT `author-link`, `author-avatar`, `parent` FROM `item` WHERE `parent-uri` = '%s' AND `uid` = %d AND `parent` != 0 ",
+ dbesc($parent_item['uri']),
+ intval($importer['uid'])
+ );
+
+ if(count($myconv)) {
+ $importer_url = $a->get_baseurl() . '/profile/' . $importer['nickname'];
+
+ foreach($myconv as $conv) {
+
+ // now if we find a match, it means we're in this conversation
+
+ if(! link_compare($conv['author-link'],$importer_url))
+ continue;
+
+ require_once('include/enotify.php');
+
+ $conv_parent = $conv['parent'];
+
+ notification(array(
+ 'type' => NOTIFY_COMMENT,
+ 'notify_flags' => $importer['notify-flags'],
+ 'language' => $importer['language'],
+ 'to_name' => $importer['username'],
+ 'to_email' => $importer['email'],
+ 'uid' => $importer['uid'],
+ 'item' => $datarray,
+ 'link' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $message_id,
+ 'source_name' => $datarray['author-name'],
+ 'source_link' => $datarray['author-link'],
+ 'source_photo' => $datarray['author-avatar'],
+ 'verb' => ACTIVITY_POST,
+ 'otype' => 'item',
+ 'parent' => $conv_parent,
+
+ ));
+
+ // only send one notification
+ break;
+ }
+ }
return;
}
diff --git a/include/items.php b/include/items.php
index 68acb45f9..5e1fec557 100755
--- a/include/items.php
+++ b/include/items.php
@@ -2026,6 +2026,7 @@ function local_delivery($importer,$data) {
if(($item['verb'] === ACTIVITY_TAG) && ($item['object-type'] === ACTVITY_OBJ_TAGTERM)) {
$xo = parse_xml_string($item['object'],false);
$xt = parse_xml_string($item['target'],false);
+
if($xt->type === ACTIVITY_OBJ_NOTE) {
$i = q("select * from `item` where uri = '%s' and uid = %d limit 1",
dbesc($xt->id),
diff --git a/include/text.php b/include/text.php
index d34fd7fbe..cdf82ca87 100644
--- a/include/text.php
+++ b/include/text.php
@@ -638,7 +638,7 @@ if(! function_exists('search')) {
function search($s,$id='search-box',$url='/search',$save = false) {
$a = get_app();
$o = '<div id="' . $id . '">';
- $o .= '<form action="' . $a->get_baseurl() . $url . '" method="get" >';
+ $o .= '<form action="' . $a->get_baseurl((stristr($url,'network')) ? true : false) . $url . '" method="get" >';
$o .= '<input type="text" name="search" id="search-text" value="' . $s .'" />';
$o .= '<input type="submit" name="submit" id="search-submit" value="' . t('Search') . '" />';
if($save)