aboutsummaryrefslogtreecommitdiffstats
path: root/include/bookmarks.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-02-24 21:34:49 -0800
committerfriendica <info@friendica.com>2014-02-24 21:34:49 -0800
commitb1021df485fb6129acda5bba616bac10aea75a45 (patch)
tree718a4771ce1fb86931531226898b0b5d00e4a337 /include/bookmarks.php
parent51a895471bb1c0a4f4a7a934a8f0dbeab8626fad (diff)
downloadvolse-hubzilla-b1021df485fb6129acda5bba616bac10aea75a45.tar.gz
volse-hubzilla-b1021df485fb6129acda5bba616bac10aea75a45.tar.bz2
volse-hubzilla-b1021df485fb6129acda5bba616bac10aea75a45.zip
provide ability to bookmark chatrooms using rbmark
Diffstat (limited to 'include/bookmarks.php')
-rw-r--r--include/bookmarks.php19
1 files changed, 17 insertions, 2 deletions
diff --git a/include/bookmarks.php b/include/bookmarks.php
index 895dedaff..21a775f9a 100644
--- a/include/bookmarks.php
+++ b/include/bookmarks.php
@@ -37,9 +37,13 @@ function bookmark_add($channel,$sender,$taxonomy,$private,$opts = null) {
$iarr['mitem_flags'] |= MENU_ITEM_ZID;
$arr = array();
- if(! $menu_name)
+ if(! $menu_name) {
$arr['menu_name'] = substr($sender['xchan_hash'],0,16) . ' ' . $sender['xchan_name'];
- $arr['menu_desc'] = sprintf( t('%1$s\'s bookmarks'), $sender['xchan_name']);
+ $arr['menu_desc'] = sprintf( t('%1$s\'s bookmarks'), $sender['xchan_name']);
+ }
+ else {
+ $arr['menu_name'] = $arr['menu_desc'] = $menu_name;
+ }
$arr['menu_flags'] = (($sender['xchan_hash'] === $channel['channel_hash']) ? MENU_BOOKMARK : MENU_SYSTEM|MENU_BOOKMARK);
$arr['menu_channel_id'] = $channel_id;
@@ -68,3 +72,14 @@ function bookmark_add($channel,$sender,$taxonomy,$private,$opts = null) {
return $r;
}
+
+function get_bookmark_link($observer) {
+
+ if((! $observer) || ($observer['xchan_network'] !== 'zot'))
+ return '';
+
+ $h = @parse_url($observer['xchan_url']);
+ if($h)
+ return $h['scheme'] . '://' . $h['host'] . (($h['port']) ? ':' . $h['port'] : '') . '/rbmark?f=';
+ return '';
+}