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

Merge pull request #1500 from RocketChat/fix/typing-status

[FIX] Typing status appearing for the current logged in user.
parents e4127ee6 745718ad
...@@ -1006,7 +1006,7 @@ class ChatRoomPresenter @Inject constructor( ...@@ -1006,7 +1006,7 @@ class ChatRoomPresenter @Inject constructor(
} }
} }
private suspend fun subscribeTypingStatus() { private fun subscribeTypingStatus() {
launch(CommonPool + strategy.jobs) { launch(CommonPool + strategy.jobs) {
client.subscribeTypingStatus(chatRoomId.toString()) { _, id -> client.subscribeTypingStatus(chatRoomId.toString()) { _, id ->
typingStatusSubscriptionId = id typingStatusSubscriptionId = id
...@@ -1019,22 +1019,25 @@ class ChatRoomPresenter @Inject constructor( ...@@ -1019,22 +1019,25 @@ class ChatRoomPresenter @Inject constructor(
} }
private fun processTypingStatus(typingStatus: Pair<String, Boolean>) { private fun processTypingStatus(typingStatus: Pair<String, Boolean>) {
if (!typingStatusList.any { username -> username == typingStatus.first }) { if (typingStatus.first != currentLoggedUsername) {
if (typingStatus.second) { if (!typingStatusList.any { username -> username == typingStatus.first }) {
typingStatusList.add(typingStatus.first)
}
} else {
typingStatusList.find { username -> username == typingStatus.first }?.let {
typingStatusList.remove(it)
if (typingStatus.second) { if (typingStatus.second) {
typingStatusList.add(typingStatus.first) typingStatusList.add(typingStatus.first)
} }
} else {
typingStatusList.find { username -> username == typingStatus.first }?.let {
typingStatusList.remove(it)
if (typingStatus.second) {
typingStatusList.add(typingStatus.first)
}
}
}
if (typingStatusList.isNotEmpty()) {
view.showTypingStatus(typingStatusList.toList())
} else {
view.hideTypingStatusView()
} }
}
if (typingStatusList.isNotEmpty()) {
view.showTypingStatus(typingStatusList.toList()) // copy typingStatusList
} else {
view.hideTypingStatusView()
} }
} }
......
...@@ -36,8 +36,9 @@ ...@@ -36,8 +36,9 @@
<string name="action_away">Ausente</string> <string name="action_away">Ausente</string>
<string name="action_busy">Ocupado</string> <string name="action_busy">Ocupado</string>
<string name="action_invisible">Invisible</string> <string name="action_invisible">Invisible</string>
<!-- TODO Add translation -->
<string name="action_drawing">Drawing</string>
<string name="action_save_to_gallery">Guardar en la galería</string> <string name="action_save_to_gallery">Guardar en la galería</string>
<string name="action_share">Compartir</string>
<!-- Settings List --> <!-- Settings List -->
<string-array name="settings_actions"> <string-array name="settings_actions">
...@@ -114,12 +115,18 @@ ...@@ -114,12 +115,18 @@
<string name="msg_is_typing">\u0020esta escribiendo…</string> <string name="msg_is_typing">\u0020esta escribiendo…</string>
<string name="msg_are_typing">\u0020están escribiendo…</string> <string name="msg_are_typing">\u0020están escribiendo…</string>
<string name="msg_several_users_are_typing">Varios usuarios están escribiendo…</string> <string name="msg_several_users_are_typing">Varios usuarios están escribiendo…</string>
<string name="msg_no_search_found">No se han encontrado resultados</string>
<string name="msg_channel_name">Nombre del Canal</string> <string name="msg_channel_name">Nombre del Canal</string>
<string name="msg_search">Buscar</string> <string name="msg_search">Buscar</string>
<string name="msg_message_copied">Mensaje copiado</string> <string name="msg_message_copied">Mensaje copiado</string>
<string name="msg_delete_message">Borrar mensaje</string> <string name="msg_delete_message">Borrar mensaje</string>
<string name="msg_delete_description">Seguro que quieres borrar este mensaje</string> <string name="msg_delete_description">Seguro que quieres borrar este mensaje</string>
<string name="msg_no_search_found">No se han encontrado resultados</string>
<!-- TODO Add translation -->
<string name="msg_upload_file">Upload file</string>
<!-- TODO Add translation -->
<string name="msg_file_description">File description</string>
<!-- TODO Add translation -->
<string name="msg_send">Send</string>
<!-- Create channel messages --> <!-- Create channel messages -->
<string name="msg_private_channel">Privado</string> <string name="msg_private_channel">Privado</string>
...@@ -168,9 +175,12 @@ ...@@ -168,9 +175,12 @@
<string name="permission_editing_not_allowed">La edición no és permitida</string> <string name="permission_editing_not_allowed">La edición no és permitida</string>
<string name="permission_deleting_not_allowed">Eliminar no és permitido</string> <string name="permission_deleting_not_allowed">Eliminar no és permitido</string>
<string name="permission_pinning_not_allowed">Fijar no és permitido</string> <string name="permission_pinning_not_allowed">Fijar no és permitido</string>
// TODO: Add proper translation. <!-- TODO Add translation -->
<string name="permission_starring_not_allowed">Starring is not allowed</string> <string name="permission_starring_not_allowed">Starring is not allowed</string>
<!-- Search message -->
<string name="title_search_message">Search message</string>
<!-- Favorite/Unfavorite chat room --> <!-- Favorite/Unfavorite chat room -->
<string name="title_favorite_chat">Chat favorito</string> <string name="title_favorite_chat">Chat favorito</string>
<string name="title_unfavorite_chat">Deshacer chat favorito</string> <string name="title_unfavorite_chat">Deshacer chat favorito</string>
...@@ -239,6 +249,8 @@ ...@@ -239,6 +249,8 @@
<!-- Emoji message--> <!-- Emoji message-->
<string name="msg_no_recent_emoji">Sin emojis recientes</string> <string name="msg_no_recent_emoji">Sin emojis recientes</string>
<!-- TODO Add translation -->
<string name="alert_title_default_skin_tone">Default skin tone</string>
<!-- Sorting and grouping--> <!-- Sorting and grouping-->
<string name="menu_chatroom_sort">Ordenar</string> <string name="menu_chatroom_sort">Ordenar</string>
...@@ -260,8 +272,6 @@ ...@@ -260,8 +272,6 @@
<string name="notif_action_reply_hint">RESPUESTA</string> <string name="notif_action_reply_hint">RESPUESTA</string>
<string name="notif_error_sending">La respuesta ha fallado. Inténtalo de nuevo.</string> <string name="notif_error_sending">La respuesta ha fallado. Inténtalo de nuevo.</string>
<string name="notif_success_sending">Mensaje enviado a %1$s!</string> <string name="notif_success_sending">Mensaje enviado a %1$s!</string>
<string name="share_label">Editar mensaje compartido</string>
<string name="read_by">Leído por</string> <string name="read_by">Leído por</string>
<string name="message_information_title">Información del mensaje</string> <string name="message_information_title">Información del mensaje</string>
<string name="msg_log_out">Saliendo de tu cuenta…</string> <string name="msg_log_out">Saliendo de tu cuenta…</string>
......
...@@ -37,6 +37,8 @@ ...@@ -37,6 +37,8 @@
<string name="action_away">Отошел</string> <string name="action_away">Отошел</string>
<string name="action_busy">Занят</string> <string name="action_busy">Занят</string>
<string name="action_invisible">Невидимый</string> <string name="action_invisible">Невидимый</string>
<!-- TODO Add translation -->
<string name="action_drawing">Drawing</string>
<string name="action_save_to_gallery">Сохранить в галерею</string> <string name="action_save_to_gallery">Сохранить в галерею</string>
<!-- Settings List --> <!-- Settings List -->
...@@ -265,5 +267,7 @@ ...@@ -265,5 +267,7 @@
<string name="notif_action_reply_hint">ОТВЕТИТЬ</string> <string name="notif_action_reply_hint">ОТВЕТИТЬ</string>
<string name="notif_error_sending">Ошибка ответа. Пожалуйста, попробуйте еще раз.</string> <string name="notif_error_sending">Ошибка ответа. Пожалуйста, попробуйте еще раз.</string>
<string name="notif_success_sending">Сообщение отправлено %1$s!</string> <string name="notif_success_sending">Сообщение отправлено %1$s!</string>
<string name="read_by">Read by</string>
<string name="message_information_title">Message information</string>
<string name="msg_log_out">Выход…</string> <string name="msg_log_out">Выход…</string>
</resources> </resources>
...@@ -120,7 +120,7 @@ ...@@ -120,7 +120,7 @@
<string name="msg_are_typing">\u0020are typing…</string> <string name="msg_are_typing">\u0020are typing…</string>
<string name="msg_several_users_are_typing">Several users are typing…</string> <string name="msg_several_users_are_typing">Several users are typing…</string>
<string name="msg_no_search_found">No result found</string> <string name="msg_no_search_found">No result found</string>
<string name="msg_log_out">Logging out...</string> <string name="msg_log_out">Logging out</string>
<string name="msg_upload_file">Upload file</string> <string name="msg_upload_file">Upload file</string>
<string name="msg_file_description">File description</string> <string name="msg_file_description">File description</string>
<string name="msg_send">Send</string> <string name="msg_send">Send</string>
......
...@@ -4,13 +4,17 @@ ...@@ -4,13 +4,17 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".ui.DrawingActivity"> tools:context=".main.ui.DrawingActivity">
<chat.rocket.android.draw.widget.CustomDrawView <chat.rocket.android.draw.widget.CustomDrawView
android:id="@+id/custom_draw_view" android:id="@+id/custom_draw_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/color_white" /> android:background="@color/color_white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView <ImageView
android:id="@+id/image_close_drawing" android:id="@+id/image_close_drawing"
......
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