Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rocket.Chat
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RocketChat
Rocket.Chat
Commits
fae0b8e1
Unverified
Commit
fae0b8e1
authored
8 years ago
by
Rodrigo Nascimento
Browse files
Options
Downloads
Patches
Plain Diff
Open new rooms for direct messages correctly via spotlight
parent
2a9cba0b
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
packages/rocketchat-ui/views/app/spotlight/spotlight.coffee
+15
-9
15 additions, 9 deletions
packages/rocketchat-ui/views/app/spotlight/spotlight.coffee
with
15 additions
and
9 deletions
packages/rocketchat-ui/views/app/spotlight/spotlight.coffee
+
15
−
9
View file @
fae0b8e1
...
...
@@ -46,6 +46,7 @@ Template.spotlight.helpers
if
server
?
.
users
?
.
length
>
0
for
user
in
server
.
users
when
not
_
.
findWhere
(
memory
,
{
t
:
'd'
,
name
:
user
.
username
})
?
memory
.
push
({
_id
:
user
.
_id
t
:
'd'
,
name
:
user
.
username
})
...
...
@@ -53,6 +54,7 @@ Template.spotlight.helpers
if
server
?
.
rooms
?
.
length
>
0
for
room
in
server
.
rooms
memory
.
push
({
_id
:
room
.
_id
t
:
'c'
,
name
:
room
.
name
})
...
...
@@ -62,15 +64,19 @@ Template.spotlight.helpers
getValue
:
(
_id
,
collection
,
firstPartValue
)
->
doc
=
collection
.
findOne
(
_id
)
# if doc.type is 'u'
# Meteor.call 'createDirectMessage', doc.username, (error, result) ->
# if error
# return handleError(error)
# if result?.rid?
# FlowRouter.go('direct', { username: doc.username })
# event.currentTarget.value = ''
# else if doc.type is 'r'
if
not
doc
?
server
=
serverResults
.
get
()
if
server
?
.
users
?
.
length
>
0
doc
=
_
.
findWhere
(
server
.
users
,
{
_id
:
_id
})
if
doc
?
doc
.
name
=
doc
.
username
doc
.
t
=
'd'
if
not
doc
?
and
server
?
.
rooms
?
.
length
>
0
doc
=
_
.
findWhere
(
server
.
rooms
,
{
_id
:
_id
})
FlowRouter
.
go
FlowRouter
.
path
RocketChat
.
roomTypes
.
getRouteLink
doc
.
t
,
doc
spotlight
.
hide
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment