Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
242e0c9b
Commit
242e0c9b
authored
Aug 22, 2017
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update classes to work with UserRepository.kt
parent
55e95336
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
5 additions
and
6 deletions
+5
-6
AutocompleteUserInteractor.kt
...hat/rocket/core/interactors/AutocompleteUserInteractor.kt
+1
-1
CanCreateRoomInteractor.kt
...a/chat/rocket/core/interactors/CanCreateRoomInteractor.kt
+1
-1
EditMessageInteractor.kt
...ava/chat/rocket/core/interactors/EditMessageInteractor.kt
+1
-1
PermissionInteractor.kt
...java/chat/rocket/core/interactors/PermissionInteractor.kt
+1
-1
UserInteractor.java
...ain/java/chat/rocket/core/interactors/UserInteractor.java
+1
-2
No files found.
rocket-chat-core/src/main/java/chat/rocket/core/interactors/AutocompleteUserInteractor.kt
View file @
242e0c9b
...
...
@@ -29,7 +29,7 @@ class AutocompleteUserInteractor(private val room: Room,
return
Flowable
.
zip
<
String
,
List
<
Message
>,
List
<
SpotlightUser
>,
Triple
<
String
,
List
<
Message
>,
List
<
SpotlightUser
>>>(
Flowable
.
just
(
name
),
messageRepository
.
getAllFrom
(
room
),
userRepository
.
getSortedLikeName
(
name
,
SortDirection
.
DESC
,
5
).
map
{
it
.
toSpotlightUsers
()
},
userRepository
.
getSortedLikeName
(
name
,
5
).
map
{
it
.
toSpotlightUsers
()
},
Function3
{
a
,
b
,
c
->
Triple
.
create
(
a
,
b
,
c
)
}
)
.
flatMap
{
triple
->
...
...
rocket-chat-core/src/main/java/chat/rocket/core/interactors/CanCreateRoomInteractor.kt
View file @
242e0c9b
...
...
@@ -14,7 +14,7 @@ class CanCreateRoomInteractor(private val userRepository: UserRepository,
fun
canCreate
(
roomId
:
String
):
Single
<
Boolean
>
{
return
Flowable
.
zip
<
Optional
<
User
>,
Optional
<
Session
>,
String
,
Boolean
>(
userRepository
.
current
,
userRepository
.
getCurrent
()
,
sessionInteractor
.
getDefault
(),
Flowable
.
just
(
roomId
),
Function3
{
user
,
session
,
room
->
user
.
isPresent
&&
session
.
isPresent
&&
room
!=
null
}
...
...
rocket-chat-core/src/main/java/chat/rocket/core/interactors/EditMessageInteractor.kt
View file @
242e0c9b
...
...
@@ -17,7 +17,7 @@ class EditMessageInteractor(private val permissionInteractor: PermissionInteract
fun
isAllowed
(
message
:
Message
):
Single
<
Boolean
>
{
return
Single
.
zip
<
Optional
<
User
>,
Optional
<
Room
>,
Optional
<
PublicSetting
>,
Optional
<
PublicSetting
>,
Pair
<
Optional
<
Room
>,
Boolean
>>(
userRepository
.
current
.
first
(
Optional
.
absent
()),
userRepository
.
getCurrent
()
.
first
(
Optional
.
absent
()),
roomRepository
.
getById
(
message
.
roomId
).
first
(
Optional
.
absent
()),
publicSettingRepository
.
getById
(
PublicSettingsConstants
.
Message
.
ALLOW_EDITING
),
publicSettingRepository
.
getById
(
PublicSettingsConstants
.
Message
.
ALLOW_EDITING_BLOCK_TIMEOUT
),
...
...
rocket-chat-core/src/main/java/chat/rocket/core/interactors/PermissionInteractor.kt
View file @
242e0c9b
...
...
@@ -14,7 +14,7 @@ class PermissionInteractor(private val userRepository: UserRepository,
private
val
permissionRepository
:
PermissionRepository
)
{
fun
isAllowed
(
permissionId
:
String
,
room
:
Room
):
Single
<
Boolean
>
{
return
userRepository
.
current
return
userRepository
.
getCurrent
()
.
first
(
Optional
.
absent
())
.
flatMap
{
if
(!
it
.
isPresent
)
{
...
...
rocket-chat-core/src/main/java/chat/rocket/core/interactors/UserInteractor.java
View file @
242e0c9b
...
...
@@ -3,7 +3,6 @@ package chat.rocket.core.interactors;
import
io.reactivex.Flowable
;
import
java.util.List
;
import
chat.rocket.core.SortDirection
;
import
chat.rocket.core.models.User
;
import
chat.rocket.core.repositories.UserRepository
;
...
...
@@ -16,6 +15,6 @@ public class UserInteractor {
}
public
Flowable
<
List
<
User
>>
getUserAutocompleteSuggestions
(
String
name
)
{
return
userRepository
.
getSortedLikeName
(
name
,
SortDirection
.
DESC
,
5
);
return
userRepository
.
getSortedLikeName
(
name
,
5
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment