provide ability to bookmark chatrooms using rbmark

This commit is contained in:
friendica
2014-02-24 21:34:49 -08:00
parent 51a895471b
commit b1021df485
3 changed files with 33 additions and 4 deletions

View File

@@ -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 '';
}