From d2565d0f61c139df6536ec9d90c10d7af29ef9e5 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sun, 20 Sep 2015 21:37:18 -0700 Subject: looks like chat has been neglected a bit recently --- include/chat.php | 2 +- include/nav.php | 5 ++--- mod/chat.php | 2 +- view/tpl/bookmarkedchats.tpl | 2 +- view/tpl/chatroom_new.tpl | 2 +- view/tpl/chatrooms.tpl | 2 +- 6 files changed, 7 insertions(+), 8 deletions(-) diff --git a/include/chat.php b/include/chat.php index a0646265a..81c5c5d62 100644 --- a/include/chat.php +++ b/include/chat.php @@ -91,7 +91,7 @@ function chatroom_destroy($channel,$arr) { return $ret; } - create_sync_packet($channel['channel_id'],array('chatroom' => $r)); + build_sync_packet($channel['channel_id'],array('chatroom' => $r)); q("delete from chatroom where cr_id = %d", intval($r[0]['cr_id']) diff --git a/include/nav.php b/include/nav.php index 59a7c83a3..972795e83 100644 --- a/include/nav.php +++ b/include/nav.php @@ -94,9 +94,8 @@ EOT; require_once('include/chat.php'); $has_chats = chatroom_list_count(local_channel()); - if($has_chats) { - $nav['usermenu'][] = Array('chat/' . $channel['channel_address'],t('Chat'),"",t('Your chatrooms'),'chat_nav_btn'); - } + $nav['usermenu'][] = Array('chat/' . $channel['channel_address'] . (($has_chats) ? '' : '/new'), t('Chat'),"",t('Your chatrooms'),'chat_nav_btn'); + require_once('include/menu.php'); $has_bookmarks = menu_list_count(local_channel(),'',MENU_BOOKMARK) + menu_list_count(local_channel(),'',MENU_SYSTEM|MENU_BOOKMARK); diff --git a/mod/chat.php b/mod/chat.php index 9ad58bc32..ef9089b6f 100644 --- a/mod/chat.php +++ b/mod/chat.php @@ -67,7 +67,7 @@ function chat_post(&$a) { intval(local_channel()) ); - create_sync_packet(0, array('chatroom' => $x)); + build_sync_packet(0, array('chatroom' => $x)); if($x) goaway(z_root() . '/chat/' . $channel['channel_address'] . '/' . $x[0]['cr_id']); diff --git a/view/tpl/bookmarkedchats.tpl b/view/tpl/bookmarkedchats.tpl index 7635bb826..ab4372c25 100644 --- a/view/tpl/bookmarkedchats.tpl +++ b/view/tpl/bookmarkedchats.tpl @@ -1,7 +1,7 @@ {{if $rooms}}

{{$header}}

-