mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-19 03:29:28 +01:00
Merge pull request #3735 from nextcloud/feature/noid/fixMarkAsReadForFederatedRooms
fix to mark federated rooms as read
This commit is contained in:
commit
4cf0fd20f2
@ -552,7 +552,7 @@ public interface NcApi {
|
|||||||
@POST
|
@POST
|
||||||
Observable<GenericOverall> setChatReadMarker(@Header("Authorization") String authorization,
|
Observable<GenericOverall> setChatReadMarker(@Header("Authorization") String authorization,
|
||||||
@Url String url,
|
@Url String url,
|
||||||
@Field("lastReadMessage") int lastReadMessage);
|
@Nullable @Field("lastReadMessage") Integer lastReadMessage);
|
||||||
|
|
||||||
// Url is: /api/{apiVersion}/chat/{token}/read
|
// Url is: /api/{apiVersion}/chat/{token}/read
|
||||||
@DELETE
|
@DELETE
|
||||||
|
@ -308,6 +308,12 @@ class ConversationsListBottomDialog(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun markConversationAsRead() {
|
private fun markConversationAsRead() {
|
||||||
|
val messageId = if (conversation.remoteServer.isNullOrEmpty()) {
|
||||||
|
conversation.lastMessage!!.jsonMessageId
|
||||||
|
} else {
|
||||||
|
null
|
||||||
|
}
|
||||||
|
|
||||||
ncApi.setChatReadMarker(
|
ncApi.setChatReadMarker(
|
||||||
credentials,
|
credentials,
|
||||||
ApiUtils.getUrlForChatReadMarker(
|
ApiUtils.getUrlForChatReadMarker(
|
||||||
@ -315,7 +321,7 @@ class ConversationsListBottomDialog(
|
|||||||
currentUser.baseUrl!!,
|
currentUser.baseUrl!!,
|
||||||
conversation.token!!
|
conversation.token!!
|
||||||
),
|
),
|
||||||
conversation.lastMessage!!.jsonMessageId
|
messageId
|
||||||
)
|
)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
@ -360,6 +366,7 @@ class ConversationsListBottomDialog(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun leaveConversation() {
|
private fun leaveConversation() {
|
||||||
val dataBuilder = Data.Builder()
|
val dataBuilder = Data.Builder()
|
||||||
dataBuilder.putString(KEY_ROOM_TOKEN, conversation.token)
|
dataBuilder.putString(KEY_ROOM_TOKEN, conversation.token)
|
||||||
|
Loading…
Reference in New Issue
Block a user