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
0b427044
Commit
0b427044
authored
Aug 16, 2017
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update SidebarMainPresenter.java
parent
15b8e060
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
SidebarMainPresenter.java
...rocket/android/fragment/sidebar/SidebarMainPresenter.java
+15
-2
No files found.
app/src/main/java/chat/rocket/android/fragment/sidebar/SidebarMainPresenter.java
View file @
0b427044
...
...
@@ -3,7 +3,9 @@ package chat.rocket.android.fragment.sidebar;
import
android.support.annotation.NonNull
;
import
android.support.v4.util.Pair
;
import
chat.rocket.core.SortDirection
;
import
chat.rocket.core.models.Spotlight
;
import
chat.rocket.persistence.realm.repositories.RealmSpotlightRepository
;
import
io.reactivex.Flowable
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
import
io.reactivex.disposables.Disposable
;
...
...
@@ -20,6 +22,7 @@ import chat.rocket.core.interactors.RoomInteractor;
import
chat.rocket.core.models.Room
;
import
chat.rocket.core.models.User
;
import
chat.rocket.core.repositories.UserRepository
;
import
java.util.List
;
public
class
SidebarMainPresenter
extends
BasePresenter
<
SidebarMainContract
.
View
>
implements
SidebarMainContract
.
Presenter
{
...
...
@@ -30,18 +33,22 @@ public class SidebarMainPresenter extends BasePresenter<SidebarMainContract.View
private
final
RocketChatCache
rocketChatCache
;
private
final
AbsoluteUrlHelper
absoluteUrlHelper
;
private
final
MethodCallHelper
methodCallHelper
;
private
RealmSpotlightRepository
realmSpotlightRepository
;
public
SidebarMainPresenter
(
String
hostname
,
RoomInteractor
roomInteractor
,
public
SidebarMainPresenter
(
String
hostname
,
RoomInteractor
roomInteractor
,
UserRepository
userRepository
,
RocketChatCache
rocketChatCache
,
AbsoluteUrlHelper
absoluteUrlHelper
,
MethodCallHelper
methodCallHelper
)
{
MethodCallHelper
methodCallHelper
,
RealmSpotlightRepository
realmSpotlightRepository
)
{
this
.
hostname
=
hostname
;
this
.
roomInteractor
=
roomInteractor
;
this
.
userRepository
=
userRepository
;
this
.
rocketChatCache
=
rocketChatCache
;
this
.
absoluteUrlHelper
=
absoluteUrlHelper
;
this
.
methodCallHelper
=
methodCallHelper
;
this
.
realmSpotlightRepository
=
realmSpotlightRepository
;
}
@Override
...
...
@@ -82,6 +89,12 @@ public class SidebarMainPresenter extends BasePresenter<SidebarMainContract.View
rocketChatCache
.
setSelectedRoomId
(
spotlight
.
getId
());
}
@Override
public
Flowable
<
List
<
Spotlight
>>
searchSpotlight
(
String
term
)
{
methodCallHelper
.
searchSpotlight
(
term
);
return
realmSpotlightRepository
.
getSuggestionsFor
(
term
,
10
);
}
@Override
public
void
onUserOnline
()
{
updateCurrentUserStatus
(
User
.
STATUS_ONLINE
);
...
...
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