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
1071f098
Commit
1071f098
authored
Feb 13, 2017
by
Tiago Cunha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A little better (?)
parent
d0e6bc2f
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
143 additions
and
97 deletions
+143
-97
RoomFragment.java
...a/chat/rocket/android/fragment/chatroom/RoomFragment.java
+7
-1
RoomPresenter.java
.../chat/rocket/android/fragment/chatroom/RoomPresenter.java
+36
-59
ModelListAdapter.java
...ocket/android/layouthelper/chatroom/ModelListAdapter.java
+1
-2
RealmMessageRepository.java
...ersistence/realm/repositories/RealmMessageRepository.java
+18
-33
MessageInteractor.java
.../java/chat/rocket/core/interactors/MessageInteractor.java
+81
-0
MessageRepository.java
...java/chat/rocket/core/repositories/MessageRepository.java
+0
-2
No files found.
app/src/main/java/chat/rocket/android/fragment/chatroom/RoomFragment.java
View file @
1071f098
...
@@ -45,6 +45,7 @@ import chat.rocket.android.layouthelper.extra_action.upload.AudioUploadActionIte
...
@@ -45,6 +45,7 @@ import chat.rocket.android.layouthelper.extra_action.upload.AudioUploadActionIte
import
chat.rocket.android.layouthelper.extra_action.upload.ImageUploadActionItem
;
import
chat.rocket.android.layouthelper.extra_action.upload.ImageUploadActionItem
;
import
chat.rocket.android.layouthelper.extra_action.upload.VideoUploadActionItem
;
import
chat.rocket.android.layouthelper.extra_action.upload.VideoUploadActionItem
;
import
chat.rocket.android.log.RCLog
;
import
chat.rocket.android.log.RCLog
;
import
chat.rocket.core.interactors.MessageInteractor
;
import
chat.rocket.core.models.Message
;
import
chat.rocket.core.models.Message
;
import
chat.rocket.core.models.Room
;
import
chat.rocket.core.models.Room
;
import
chat.rocket.persistence.realm.repositories.RealmMessageRepository
;
import
chat.rocket.persistence.realm.repositories.RealmMessageRepository
;
...
@@ -109,11 +110,16 @@ public class RoomFragment extends AbstractChatRoomFragment
...
@@ -109,11 +110,16 @@ public class RoomFragment extends AbstractChatRoomFragment
hostname
=
args
.
getString
(
HOSTNAME
);
hostname
=
args
.
getString
(
HOSTNAME
);
roomId
=
args
.
getString
(
ROOM_ID
);
roomId
=
args
.
getString
(
ROOM_ID
);
MessageInteractor
messageInteractor
=
new
MessageInteractor
(
new
RealmMessageRepository
(
hostname
),
new
RealmRoomRepository
(
hostname
)
);
presenter
=
new
RoomPresenter
(
presenter
=
new
RoomPresenter
(
roomId
,
roomId
,
new
RealmUserRepository
(
hostname
),
new
RealmUserRepository
(
hostname
),
messageInteractor
,
new
RealmRoomRepository
(
hostname
),
new
RealmRoomRepository
(
hostname
),
new
RealmMessageRepository
(
hostname
),
new
MethodCallHelper
(
getContext
(),
hostname
),
new
MethodCallHelper
(
getContext
(),
hostname
),
ConnectivityManager
.
getInstance
(
getContext
())
ConnectivityManager
.
getInstance
(
getContext
())
);
);
...
...
app/src/main/java/chat/rocket/android/fragment/chatroom/RoomPresenter.java
View file @
1071f098
...
@@ -4,15 +4,15 @@ import android.support.annotation.NonNull;
...
@@ -4,15 +4,15 @@ import android.support.annotation.NonNull;
import
android.support.annotation.Nullable
;
import
android.support.annotation.Nullable
;
import
android.support.v4.util.Pair
;
import
android.support.v4.util.Pair
;
import
java.util.UUID
;
import
chat.rocket.android.BackgroundLooper
;
import
chat.rocket.android.BackgroundLooper
;
import
chat.rocket.android.api.MethodCallHelper
;
import
chat.rocket.android.api.MethodCallHelper
;
import
chat.rocket.android.helper.LogcatIfError
;
import
chat.rocket.android.helper.LogcatIfError
;
import
chat.rocket.android.shared.BasePresenter
;
import
chat.rocket.android.shared.BasePresenter
;
import
chat.rocket.core.SyncState
;
import
chat.rocket.core.SyncState
;
import
chat.rocket.core.interactors.MessageInteractor
;
import
chat.rocket.core.models.Message
;
import
chat.rocket.core.models.Message
;
import
chat.rocket.core.models.Room
HistoryState
;
import
chat.rocket.core.models.Room
;
import
chat.rocket.core.
repositories.MessageRepository
;
import
chat.rocket.core.
models.User
;
import
chat.rocket.core.repositories.RoomRepository
;
import
chat.rocket.core.repositories.RoomRepository
;
import
chat.rocket.core.repositories.UserRepository
;
import
chat.rocket.core.repositories.UserRepository
;
import
chat.rocket.android.service.ConnectivityManagerApi
;
import
chat.rocket.android.service.ConnectivityManagerApi
;
...
@@ -24,21 +24,22 @@ public class RoomPresenter extends BasePresenter<RoomContract.View>
...
@@ -24,21 +24,22 @@ public class RoomPresenter extends BasePresenter<RoomContract.View>
implements
RoomContract
.
Presenter
{
implements
RoomContract
.
Presenter
{
private
final
String
roomId
;
private
final
String
roomId
;
private
final
MessageInteractor
messageInteractor
;
private
final
UserRepository
userRepository
;
private
final
UserRepository
userRepository
;
private
final
RoomRepository
roomRepository
;
private
final
RoomRepository
roomRepository
;
private
final
MessageRepository
messageRepository
;
private
final
MethodCallHelper
methodCallHelper
;
private
final
MethodCallHelper
methodCallHelper
;
private
final
ConnectivityManagerApi
connectivityManagerApi
;
private
final
ConnectivityManagerApi
connectivityManagerApi
;
public
RoomPresenter
(
String
roomId
,
UserRepository
userRepository
,
public
RoomPresenter
(
String
roomId
,
UserRepository
userRepository
,
MessageInteractor
messageInteractor
,
RoomRepository
roomRepository
,
RoomRepository
roomRepository
,
MessageRepository
messageRepository
,
MethodCallHelper
methodCallHelper
,
MethodCallHelper
methodCallHelper
,
ConnectivityManagerApi
connectivityManagerApi
)
{
ConnectivityManagerApi
connectivityManagerApi
)
{
this
.
roomId
=
roomId
;
this
.
roomId
=
roomId
;
this
.
userRepository
=
userRepository
;
this
.
userRepository
=
userRepository
;
this
.
messageInteractor
=
messageInteractor
;
this
.
roomRepository
=
roomRepository
;
this
.
roomRepository
=
roomRepository
;
this
.
messageRepository
=
messageRepository
;
this
.
methodCallHelper
=
methodCallHelper
;
this
.
methodCallHelper
=
methodCallHelper
;
this
.
connectivityManagerApi
=
connectivityManagerApi
;
this
.
connectivityManagerApi
=
connectivityManagerApi
;
}
}
...
@@ -54,16 +55,8 @@ public class RoomPresenter extends BasePresenter<RoomContract.View>
...
@@ -54,16 +55,8 @@ public class RoomPresenter extends BasePresenter<RoomContract.View>
@Override
@Override
public
void
loadMessages
()
{
public
void
loadMessages
()
{
RoomHistoryState
roomHistoryState
=
RoomHistoryState
.
builder
()
final
Subscription
subscription
=
getSingleRoom
()
.
setRoomId
(
roomId
)
.
flatMap
(
messageInteractor:
:
loadMessages
)
.
setSyncState
(
SyncState
.
NOT_SYNCED
)
.
setCount
(
100
)
.
setReset
(
true
)
.
setComplete
(
false
)
.
setTimestamp
(
0
)
.
build
();
final
Subscription
subscription
=
roomRepository
.
setHistoryState
(
roomHistoryState
)
.
subscribeOn
(
AndroidSchedulers
.
from
(
BackgroundLooper
.
get
()))
.
subscribeOn
(
AndroidSchedulers
.
from
(
BackgroundLooper
.
get
()))
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
success
->
{
.
subscribe
(
success
->
{
...
@@ -78,16 +71,8 @@ public class RoomPresenter extends BasePresenter<RoomContract.View>
...
@@ -78,16 +71,8 @@ public class RoomPresenter extends BasePresenter<RoomContract.View>
@Override
@Override
public
void
loadMoreMessages
()
{
public
void
loadMoreMessages
()
{
final
Subscription
subscription
=
roomRepository
.
getHistoryStateByRoomId
(
roomId
)
final
Subscription
subscription
=
getSingleRoom
()
.
filter
(
roomHistoryState
->
{
.
flatMap
(
messageInteractor:
:
loadMoreMessages
)
int
syncState
=
roomHistoryState
.
getSyncState
();
return
!
roomHistoryState
.
isComplete
()
&&
(
syncState
==
SyncState
.
SYNCED
||
syncState
==
SyncState
.
FAILED
);
})
.
first
()
.
toSingle
()
.
flatMap
(
roomHistoryState
->
roomRepository
.
setHistoryState
(
roomHistoryState
.
withSyncState
(
SyncState
.
NOT_SYNCED
)))
.
subscribeOn
(
AndroidSchedulers
.
from
(
BackgroundLooper
.
get
()))
.
subscribeOn
(
AndroidSchedulers
.
from
(
BackgroundLooper
.
get
()))
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
success
->
{
.
subscribe
(
success
->
{
...
@@ -112,23 +97,8 @@ public class RoomPresenter extends BasePresenter<RoomContract.View>
...
@@ -112,23 +97,8 @@ public class RoomPresenter extends BasePresenter<RoomContract.View>
@Override
@Override
public
void
sendMessage
(
String
messageText
)
{
public
void
sendMessage
(
String
messageText
)
{
final
Subscription
subscription
=
userRepository
.
getCurrent
()
final
Subscription
subscription
=
getRoomUserPair
()
.
filter
(
user
->
user
!=
null
)
.
flatMap
(
pair
->
messageInteractor
.
send
(
pair
.
first
,
pair
.
second
,
messageText
))
.
first
()
.
toSingle
()
.
flatMap
(
user
->
{
Message
message
=
Message
.
builder
()
.
setId
(
UUID
.
randomUUID
().
toString
())
.
setSyncState
(
SyncState
.
NOT_SYNCED
)
.
setTimestamp
(
System
.
currentTimeMillis
())
.
setRoomId
(
roomId
)
.
setMessage
(
messageText
)
.
setGroupable
(
false
)
.
setUser
(
user
)
.
build
();
return
messageRepository
.
save
(
message
);
})
.
subscribeOn
(
AndroidSchedulers
.
from
(
BackgroundLooper
.
get
()))
.
subscribeOn
(
AndroidSchedulers
.
from
(
BackgroundLooper
.
get
()))
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
success
->
{
.
subscribe
(
success
->
{
...
@@ -142,8 +112,7 @@ public class RoomPresenter extends BasePresenter<RoomContract.View>
...
@@ -142,8 +112,7 @@ public class RoomPresenter extends BasePresenter<RoomContract.View>
@Override
@Override
public
void
resendMessage
(
Message
message
)
{
public
void
resendMessage
(
Message
message
)
{
final
Subscription
subscription
=
messageRepository
.
resend
(
final
Subscription
subscription
=
messageInteractor
.
resend
(
message
)
message
.
withSyncState
(
SyncState
.
NOT_SYNCED
))
.
subscribeOn
(
AndroidSchedulers
.
from
(
BackgroundLooper
.
get
()))
.
subscribeOn
(
AndroidSchedulers
.
from
(
BackgroundLooper
.
get
()))
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
();
.
subscribe
();
...
@@ -153,7 +122,7 @@ public class RoomPresenter extends BasePresenter<RoomContract.View>
...
@@ -153,7 +122,7 @@ public class RoomPresenter extends BasePresenter<RoomContract.View>
@Override
@Override
public
void
deleteMessage
(
Message
message
)
{
public
void
deleteMessage
(
Message
message
)
{
final
Subscription
subscription
=
message
Repository
.
delete
(
message
)
final
Subscription
subscription
=
message
Interactor
.
delete
(
message
)
.
subscribeOn
(
AndroidSchedulers
.
from
(
BackgroundLooper
.
get
()))
.
subscribeOn
(
AndroidSchedulers
.
from
(
BackgroundLooper
.
get
()))
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
();
.
subscribe
();
...
@@ -163,17 +132,8 @@ public class RoomPresenter extends BasePresenter<RoomContract.View>
...
@@ -163,17 +132,8 @@ public class RoomPresenter extends BasePresenter<RoomContract.View>
@Override
@Override
public
void
onUnreadCount
()
{
public
void
onUnreadCount
()
{
final
Subscription
subscription
=
Single
.
zip
(
final
Subscription
subscription
=
getRoomUserPair
()
userRepository
.
getCurrent
()
.
flatMap
(
roomUserPair
->
messageInteractor
.
filter
(
user
->
user
!=
null
)
.
first
()
.
toSingle
(),
roomRepository
.
getById
(
roomId
)
.
first
()
.
toSingle
(),
(
user
,
room
)
->
new
Pair
<>(
room
,
user
)
)
.
flatMap
(
roomUserPair
->
messageRepository
.
unreadCountFor
(
roomUserPair
.
first
,
roomUserPair
.
second
))
.
unreadCountFor
(
roomUserPair
.
first
,
roomUserPair
.
second
))
.
subscribeOn
(
AndroidSchedulers
.
from
(
BackgroundLooper
.
get
()))
.
subscribeOn
(
AndroidSchedulers
.
from
(
BackgroundLooper
.
get
()))
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
...
@@ -232,11 +192,28 @@ public class RoomPresenter extends BasePresenter<RoomContract.View>
...
@@ -232,11 +192,28 @@ public class RoomPresenter extends BasePresenter<RoomContract.View>
private
void
getMessages
()
{
private
void
getMessages
()
{
final
Subscription
subscription
=
roomRepository
.
getById
(
roomId
)
final
Subscription
subscription
=
roomRepository
.
getById
(
roomId
)
.
first
()
.
first
()
.
flatMap
(
message
Repository
:
:
getAllFrom
)
.
flatMap
(
message
Interactor
:
:
getAllFrom
)
.
subscribeOn
(
AndroidSchedulers
.
from
(
BackgroundLooper
.
get
()))
.
subscribeOn
(
AndroidSchedulers
.
from
(
BackgroundLooper
.
get
()))
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
messages
->
view
.
showMessages
(
messages
));
.
subscribe
(
messages
->
view
.
showMessages
(
messages
));
addSubscription
(
subscription
);
addSubscription
(
subscription
);
}
}
private
Single
<
Pair
<
Room
,
User
>>
getRoomUserPair
()
{
return
Single
.
zip
(
getSingleRoom
(),
userRepository
.
getCurrent
()
.
filter
(
user
->
user
!=
null
)
.
first
()
.
toSingle
(),
Pair:
:
new
);
}
private
Single
<
Room
>
getSingleRoom
()
{
return
roomRepository
.
getById
(
roomId
)
.
first
()
.
toSingle
();
}
}
}
app/src/main/java/chat/rocket/android/layouthelper/chatroom/ModelListAdapter.java
View file @
1071f098
...
@@ -25,9 +25,8 @@ public abstract class ModelListAdapter<T, VM, VH extends ModelViewHolder<VM>>
...
@@ -25,9 +25,8 @@ public abstract class ModelListAdapter<T, VM, VH extends ModelViewHolder<VM>>
protected
abstract
int
getRealmModelViewType
(
VM
model
);
protected
abstract
int
getRealmModelViewType
(
VM
model
);
protected
abstract
@LayoutRes
@LayoutRes
int
getLayout
(
int
viewType
);
protected
abstract
int
getLayout
(
int
viewType
);
protected
abstract
VH
onCreateRealmModelViewHolder
(
int
viewType
,
View
itemView
);
protected
abstract
VH
onCreateRealmModelViewHolder
(
int
viewType
,
View
itemView
);
...
...
persistence-realm/src/main/java/chat/rocket/persistence/realm/repositories/RealmMessageRepository.java
View file @
1071f098
...
@@ -69,47 +69,32 @@ public class RealmMessageRepository extends RealmRepository implements MessageRe
...
@@ -69,47 +69,32 @@ public class RealmMessageRepository extends RealmRepository implements MessageRe
return
Single
.
just
(
false
);
return
Single
.
just
(
false
);
}
}
// need to improve this for real
RealmMessage
realmMessage
=
realm
.
where
(
RealmMessage
.
class
)
final
JSONObject
messageToSend
=
new
JSONObject
()
.
equalTo
(
RealmMessage
.
ID
,
message
.
getId
())
.
put
(
RealmMessage
.
ID
,
message
.
getId
())
.
findFirst
();
.
put
(
RealmMessage
.
SYNC_STATE
,
message
.
getSyncState
())
.
put
(
RealmMessage
.
TIMESTAMP
,
message
.
getTimestamp
())
.
put
(
RealmMessage
.
ROOM_ID
,
message
.
getRoomId
())
.
put
(
RealmMessage
.
USER
,
new
JSONObject
()
.
put
(
RealmUser
.
ID
,
message
.
getUser
().
getId
()))
.
put
(
RealmMessage
.
MESSAGE
,
message
.
getMessage
());
realm
.
beginTransaction
();
return
realm
.
createOrUpdateObjectFromJson
(
RealmMessage
.
class
,
messageToSend
)
if
(
realmMessage
==
null
)
{
.
asObservable
()
realmMessage
=
new
RealmMessage
();
.
unsubscribeOn
(
AndroidSchedulers
.
from
(
looper
))
}
else
{
.
doOnUnsubscribe
(()
->
close
(
realm
,
looper
))
realmMessage
=
realm
.
copyFromRealm
(
realmMessage
);
.
filter
(
it
->
it
!=
null
&&
it
.
isLoaded
()
&&
it
.
isValid
())
.
first
()
.
doOnNext
(
it
->
realm
.
commitTransaction
())
.
toSingle
()
.
map
(
realmObject
->
true
);
});
}
}
@Override
realmMessage
.
setId
(
message
.
getId
());
public
Single
<
Boolean
>
resend
(
Message
message
)
{
realmMessage
.
setSyncState
(
message
.
getSyncState
());
return
Single
.
defer
(()
->
{
realmMessage
.
setTimestamp
(
message
.
getTimestamp
());
final
Realm
realm
=
RealmStore
.
getRealm
(
hostname
);
realmMessage
.
setRoomId
(
message
.
getRoomId
()
);
final
Looper
looper
=
Looper
.
myLooper
(
);
realmMessage
.
setMessage
(
message
.
getMessage
()
);
if
(
realm
==
null
)
{
RealmUser
realmUser
=
realmMessage
.
getUser
();
return
Single
.
just
(
false
);
if
(
realmUser
==
null
)
{
realmUser
=
new
RealmUser
();
}
}
final
JSONObject
messageToSend
=
new
JSONObject
()
realmUser
.
setId
(
message
.
getUser
().
getId
());
.
put
(
RealmMessage
.
ID
,
message
.
getId
())
.
put
(
RealmMessage
.
SYNC_STATE
,
message
.
getSyncState
());
realm
.
beginTransaction
();
realm
.
beginTransaction
();
return
realm
.
c
reateOrUpdateObjectFromJson
(
RealmMessage
.
class
,
messageToSend
)
return
realm
.
c
opyToRealmOrUpdate
(
realmMessage
)
.
asObservable
()
.
asObservable
()
.
unsubscribeOn
(
AndroidSchedulers
.
from
(
looper
))
.
unsubscribeOn
(
AndroidSchedulers
.
from
(
looper
))
.
doOnUnsubscribe
(()
->
close
(
realm
,
looper
))
.
doOnUnsubscribe
(()
->
close
(
realm
,
looper
))
...
...
rocket-chat-core/src/main/java/chat/rocket/core/interactors/MessageInteractor.java
0 → 100644
View file @
1071f098
package
chat
.
rocket
.
core
.
interactors
;
import
java.util.List
;
import
java.util.UUID
;
import
chat.rocket.core.SyncState
;
import
chat.rocket.core.models.Message
;
import
chat.rocket.core.models.Room
;
import
chat.rocket.core.models.RoomHistoryState
;
import
chat.rocket.core.models.User
;
import
chat.rocket.core.repositories.MessageRepository
;
import
chat.rocket.core.repositories.RoomRepository
;
import
rx.Observable
;
import
rx.Single
;
public
class
MessageInteractor
{
private
final
MessageRepository
messageRepository
;
private
final
RoomRepository
roomRepository
;
public
MessageInteractor
(
MessageRepository
messageRepository
,
RoomRepository
roomRepository
)
{
this
.
messageRepository
=
messageRepository
;
this
.
roomRepository
=
roomRepository
;
}
public
Single
<
Boolean
>
loadMessages
(
Room
room
)
{
final
RoomHistoryState
roomHistoryState
=
RoomHistoryState
.
builder
()
.
setRoomId
(
room
.
getRoomId
())
.
setSyncState
(
SyncState
.
NOT_SYNCED
)
.
setCount
(
100
)
.
setReset
(
true
)
.
setComplete
(
false
)
.
setTimestamp
(
0
)
.
build
();
return
roomRepository
.
setHistoryState
(
roomHistoryState
);
}
public
Single
<
Boolean
>
loadMoreMessages
(
Room
room
)
{
return
roomRepository
.
getHistoryStateByRoomId
(
room
.
getRoomId
())
.
filter
(
roomHistoryState
->
{
int
syncState
=
roomHistoryState
.
getSyncState
();
return
!
roomHistoryState
.
isComplete
()
&&
(
syncState
==
SyncState
.
SYNCED
||
syncState
==
SyncState
.
FAILED
);
})
.
first
()
.
toSingle
()
.
flatMap
(
roomHistoryState
->
roomRepository
.
setHistoryState
(
roomHistoryState
.
withSyncState
(
SyncState
.
NOT_SYNCED
)));
}
public
Single
<
Boolean
>
send
(
Room
destination
,
User
sender
,
String
messageText
)
{
final
Message
message
=
Message
.
builder
()
.
setId
(
UUID
.
randomUUID
().
toString
())
.
setSyncState
(
SyncState
.
NOT_SYNCED
)
.
setTimestamp
(
System
.
currentTimeMillis
())
.
setRoomId
(
destination
.
getRoomId
())
.
setMessage
(
messageText
)
.
setGroupable
(
false
)
.
setUser
(
sender
)
.
build
();
return
messageRepository
.
save
(
message
);
}
public
Single
<
Boolean
>
resend
(
Message
message
)
{
return
messageRepository
.
save
(
message
.
withSyncState
(
SyncState
.
NOT_SYNCED
));
}
public
Single
<
Boolean
>
delete
(
Message
message
)
{
return
messageRepository
.
delete
(
message
);
}
public
Single
<
Integer
>
unreadCountFor
(
Room
room
,
User
user
)
{
return
messageRepository
.
unreadCountFor
(
room
,
user
);
}
public
Observable
<
List
<
Message
>>
getAllFrom
(
Room
room
)
{
return
messageRepository
.
getAllFrom
(
room
);
}
}
rocket-chat-core/src/main/java/chat/rocket/core/repositories/MessageRepository.java
View file @
1071f098
...
@@ -13,8 +13,6 @@ public interface MessageRepository {
...
@@ -13,8 +13,6 @@ public interface MessageRepository {
Single
<
Boolean
>
save
(
Message
message
);
Single
<
Boolean
>
save
(
Message
message
);
Single
<
Boolean
>
resend
(
Message
message
);
Single
<
Boolean
>
delete
(
Message
message
);
Single
<
Boolean
>
delete
(
Message
message
);
Observable
<
List
<
Message
>>
getAllFrom
(
Room
room
);
Observable
<
List
<
Message
>>
getAllFrom
(
Room
room
);
...
...
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