Supporting Private Group reopening (Fixes #740)
- Adding Private Groups list ("More groups")
- Bug fixed: rocketchat_subscription "open" flag is now updated when user reopens a given room
pull/765/head
parent
35786b99ef
commit
c7b87fb63b
@ -0,0 +1,11 @@ |
||||
Meteor.methods |
||||
openRoom: (rid) -> |
||||
if not Meteor.userId() |
||||
throw new Meteor.Error 'invalid-user', '[methods] openRoom -> Invalid user' |
||||
|
||||
ChatSubscription.update |
||||
rid: rid |
||||
'u._id': Meteor.userId() |
||||
, |
||||
$set: |
||||
open: true |
||||
@ -0,0 +1,19 @@ |
||||
Template.listPrivateGroupsFlex.helpers |
||||
groups: -> |
||||
return ChatSubscription.find { t: { $in: ['p']}, f: { $ne: true } }, { sort: 't': 1, 'name': 1 } |
||||
|
||||
Template.listPrivateGroupsFlex.events |
||||
'click header': -> |
||||
SideNav.closeFlex() |
||||
|
||||
'click .channel-link': -> |
||||
SideNav.closeFlex() |
||||
|
||||
'click footer .create': -> |
||||
SideNav.setFlex "createChannelFlex" |
||||
|
||||
'mouseenter header': -> |
||||
SideNav.overArrow() |
||||
|
||||
'mouseleave header': -> |
||||
SideNav.leaveArrow() |
||||
@ -0,0 +1,27 @@ |
||||
<template name="listPrivateGroupsFlex"> |
||||
<header> |
||||
<div> |
||||
<h4>{{_ "Private_Groups"}}</h4> |
||||
</div> |
||||
</header> |
||||
<div class="content"> |
||||
<div class="wrapper"> |
||||
<h4>{{_ "Private_Groups_list"}}</h4> |
||||
<ul> |
||||
{{#each groups}} |
||||
<li> |
||||
<a href="{{pathFor 'group' name=name}}" class="channel-link"> |
||||
<i class="icon-lock"></i> |
||||
{{name}} |
||||
</a> |
||||
</li> |
||||
{{/each}} |
||||
</ul> |
||||
</div> |
||||
</div> |
||||
<footer> |
||||
<div> |
||||
<button class="button clean create">{{_ "Create_new"}}</button> |
||||
</div> |
||||
</footer> |
||||
</template> |
||||
@ -0,0 +1,13 @@ |
||||
Meteor.methods |
||||
openRoom: (rid) -> |
||||
if not Meteor.userId() |
||||
throw new Meteor.Error 'invalid-user', '[methods] openRoom -> Invalid user' |
||||
|
||||
console.log '[methods] openRoom -> '.green, 'userId:', Meteor.userId(), 'arguments:', arguments |
||||
|
||||
ChatSubscription.update |
||||
rid: rid |
||||
'u._id': Meteor.userId() |
||||
, |
||||
$set: |
||||
open: true |
||||
Loading…
Reference in new issue