From b1021df485fb6129acda5bba616bac10aea75a45 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 24 Feb 2014 21:34:49 -0800 Subject: provide ability to bookmark chatrooms using rbmark --- include/bookmarks.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'include/bookmarks.php') 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 ''; +} -- cgit v1.2.3