Unverified Commit 829b0fce authored by Filipe de Lima Brito's avatar Filipe de Lima Brito Committed by GitHub

Merge branch 'develop' into chore/russian-typo

parents 33c2a929 e9cea381
...@@ -316,6 +316,7 @@ class ChatRoomPresenter @Inject constructor( ...@@ -316,6 +316,7 @@ class ChatRoomPresenter @Inject constructor(
fun sendMessage(chatRoomId: String, text: String, messageId: String?) { fun sendMessage(chatRoomId: String, text: String, messageId: String?) {
launchUI(strategy) { launchUI(strategy) {
try { try {
view.disableSendMessageButton()
// ignore message for now, will receive it on the stream // ignore message for now, will receive it on the stream
if (messageId == null) { if (messageId == null) {
val id = UUID.randomUUID().toString() val id = UUID.randomUUID().toString()
......
...@@ -2,6 +2,7 @@ package chat.rocket.android.chatrooms.presentation ...@@ -2,6 +2,7 @@ package chat.rocket.android.chatrooms.presentation
import chat.rocket.android.R import chat.rocket.android.R
import chat.rocket.android.chatrooms.adapter.model.RoomUiModel import chat.rocket.android.chatrooms.adapter.model.RoomUiModel
import chat.rocket.android.chatrooms.domain.FetchChatRoomsInteractor
import chat.rocket.android.core.lifecycle.CancelStrategy import chat.rocket.android.core.lifecycle.CancelStrategy
import chat.rocket.android.db.DatabaseManager import chat.rocket.android.db.DatabaseManager
import chat.rocket.android.db.model.ChatRoomEntity import chat.rocket.android.db.model.ChatRoomEntity
...@@ -116,6 +117,7 @@ class ChatRoomsPresenter @Inject constructor( ...@@ -116,6 +117,7 @@ class ChatRoomsPresenter @Inject constructor(
retryIO("createDirectMessage($name)") { retryIO("createDirectMessage($name)") {
withTimeout(10000) { withTimeout(10000) {
createDirectMessage(name) createDirectMessage(name)
FetchChatRoomsInteractor(client, dbManager).refreshChatRooms()
} }
} }
val fromTo = mutableListOf(myself.id, id).apply { val fromTo = mutableListOf(myself.id, id).apply {
......
...@@ -38,6 +38,9 @@ import kotlinx.android.synthetic.main.activity_main.* ...@@ -38,6 +38,9 @@ import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.android.synthetic.main.app_bar.* import kotlinx.android.synthetic.main.app_bar.*
import kotlinx.android.synthetic.main.nav_header.view.* import kotlinx.android.synthetic.main.nav_header.view.*
import javax.inject.Inject import javax.inject.Inject
import android.app.NotificationManager
import android.content.Context
private const val CURRENT_STATE = "current_state" private const val CURRENT_STATE = "current_state"
...@@ -90,6 +93,9 @@ class MainActivity : AppCompatActivity(), MainView, HasActivityInjector, ...@@ -90,6 +93,9 @@ class MainActivity : AppCompatActivity(), MainView, HasActivityInjector,
presenter.toChatList(chatRoomId) presenter.toChatList(chatRoomId)
isFragmentAdded = true isFragmentAdded = true
} }
val notificationManager = getSystemService(Context.NOTIFICATION_SERVICE)
as NotificationManager
notificationManager.cancelAll()
} }
override fun onDestroy() { override fun onDestroy() {
......
...@@ -82,7 +82,7 @@ class ProfilePresenter @Inject constructor( ...@@ -82,7 +82,7 @@ class ProfilePresenter @Inject constructor(
view.showLoading() view.showLoading()
try { try {
user?.id?.let { id -> user?.id?.let { id ->
retryIO { client.updateProfile(id, email, name, username) } retryIO { client.updateProfile(userId = id, email = email, name = name, username = username) }
view.showProfileUpdateSuccessfullyMessage() view.showProfileUpdateSuccessfullyMessage()
view.showProfile( view.showProfile(
serverUrl.avatarUrl(user.username ?: ""), serverUrl.avatarUrl(user.username ?: ""),
...@@ -198,4 +198,4 @@ class ProfilePresenter @Inject constructor( ...@@ -198,4 +198,4 @@ class ProfilePresenter @Inject constructor(
} }
} }
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment