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
d99a39ec
Commit
d99a39ec
authored
May 11, 2018
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove filtering.
parent
9f6519b9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
FavoriteMessagesPresenter.kt
...avoritemessages/presentation/FavoriteMessagesPresenter.kt
+6
-5
No files found.
app/src/main/java/chat/rocket/android/favoritemessages/presentation/FavoriteMessagesPresenter.kt
View file @
d99a39ec
package
chat.rocket.android.favoritemessages.presentation
import
chat.rocket.android.chatroom.viewmodel.BaseViewModel
import
chat.rocket.android.chatroom.viewmodel.ImageAttachmentViewModel
import
chat.rocket.android.chatroom.viewmodel.ViewModelMapper
import
chat.rocket.android.core.lifecycle.CancelStrategy
import
chat.rocket.android.server.domain.GetChatRoomsInteractor
...
...
@@ -9,7 +11,6 @@ import chat.rocket.android.util.extensions.launchUI
import
chat.rocket.common.RocketChatException
import
chat.rocket.common.util.ifNull
import
chat.rocket.core.internal.rest.getFavoriteMessages
import
chat.rocket.core.model.isSystemMessage
import
timber.log.Timber
import
javax.inject.Inject
...
...
@@ -22,7 +23,7 @@ class FavoriteMessagesPresenter @Inject constructor(
factory
:
RocketChatClientFactory
)
{
private
val
client
=
factory
.
create
(
serverInteractor
.
get
()
!!
)
private
var
favoriteMessagesListO
ffset
:
Int
=
0
private
var
o
ffset
:
Int
=
0
/**
* Loads all favorite messages for room. the given room id.
...
...
@@ -37,10 +38,10 @@ class FavoriteMessagesPresenter @Inject constructor(
chatRoom
?.
let
{
room
->
view
.
showLoading
()
val
favoriteMessages
=
client
.
getFavoriteMessages
(
roomId
,
room
.
type
,
favoriteMessagesListO
ffset
)
favoriteMessagesListO
ffset
=
favoriteMessages
.
offset
.
toInt
()
client
.
getFavoriteMessages
(
roomId
,
room
.
type
,
o
ffset
)
o
ffset
=
favoriteMessages
.
offset
.
toInt
()
val
messageList
=
mapper
.
map
(
favoriteMessages
.
result
.
filterNot
{
it
.
isSystemMessage
()
}
)
mapper
.
map
(
favoriteMessages
.
result
)
view
.
showFavoriteMessages
(
messageList
)
view
.
hideLoading
()
}.
ifNull
{
...
...
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