Commit fdc55abd authored by Łukasz Rutkowski's avatar Łukasz Rutkowski

Displays users who reacted in dialog

parent fa5346fc
...@@ -1084,10 +1084,6 @@ class ChatRoomPresenter @Inject constructor( ...@@ -1084,10 +1084,6 @@ class ChatRoomPresenter @Inject constructor(
view.showReactionsPopup(messageId) view.showReactionsPopup(messageId)
} }
fun showReactionsSummary(emojiShortname: String, usernames: List<String>) {
view.showReactionsSummary(emojiShortname, usernames, currentLoggedUsername)
}
fun loadCommands() { fun loadCommands() {
launchUI(strategy) { launchUI(strategy) {
try { try {
......
...@@ -140,8 +140,6 @@ interface ChatRoomView : LoadingView, MessageView { ...@@ -140,8 +140,6 @@ interface ChatRoomView : LoadingView, MessageView {
fun showReactionsPopup(messageId: String) fun showReactionsPopup(messageId: String)
fun showReactionsSummary(emojiShortname: String, usernames: List<String>, currentLoggedUsername: String?)
/** /**
* Show list of commands. * Show list of commands.
* *
......
...@@ -666,30 +666,11 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR ...@@ -666,30 +666,11 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
} }
override fun onReactionLongClicked(emojiShortname: String, usernames: List<String>) { override fun onReactionLongClicked(emojiShortname: String, usernames: List<String>) {
presenter.showReactionsSummary(emojiShortname, usernames) AlertDialog.Builder(requireContext())
} .setTitle(EmojiParser.parse(requireContext(), getString(R.string.alert_title_reactions_by, emojiShortname)))
.setItems(usernames.toTypedArray(), null)
override fun showReactionsSummary(emojiShortname: String, usernames: List<String>, currentLoggedUsername: String?) { .setPositiveButton(R.string.msg_ok, null)
var usernamesString = usernames.asSequence() .show()
.take(15)
.joinToString { username ->
if (username == currentLoggedUsername) {
getString(R.string.msg_you).toLowerCase()
} else {
"@$username"
}
}
if (usernames.size > 15) {
usernamesString += " " + getString(R.string.And_more, usernames.size - 15).toLowerCase()
} else {
usernamesString = usernamesString.replace(""",([^,]+)$""".toRegex()) {
" ${getString(R.string.and)}${it.groupValues[1]}"
}
}
if (usernamesString[0] != '@') {
usernamesString = usernamesString.capitalize()
}
showToast("$usernamesString ${getString(R.string.Reacted_with).toLowerCase()} $emojiShortname", Toast.LENGTH_LONG)
} }
override fun showReactionsPopup(messageId: String) { override fun showReactionsPopup(messageId: String) {
......
...@@ -282,9 +282,6 @@ ...@@ -282,9 +282,6 @@
<!-- Emoji message--> <!-- Emoji message-->
<string name="msg_no_recent_emoji">Keine letzten Emojis</string> <string name="msg_no_recent_emoji">Keine letzten Emojis</string>
<string name="alert_title_default_skin_tone">Standart Hautton</string> <string name="alert_title_default_skin_tone">Standart Hautton</string>
<string name="And_more">Und %1$d mehr</string>
<string name="and">und</string>
<string name="Reacted_with">Reagierte mit</string>
<!-- Sorting and grouping--> <!-- Sorting and grouping-->
<string name="menu_chatroom_sort">Sortiere</string> <string name="menu_chatroom_sort">Sortiere</string>
......
...@@ -278,9 +278,6 @@ ...@@ -278,9 +278,6 @@
<!-- Emoji message--> <!-- Emoji message-->
<string name="msg_no_recent_emoji">Sin emojis recientes</string> <string name="msg_no_recent_emoji">Sin emojis recientes</string>
<string name="alert_title_default_skin_tone">Tono de piel predeterminado</string> <string name="alert_title_default_skin_tone">Tono de piel predeterminado</string>
<string name="And_more">Y %1$d mas</string>
<string name="and">y</string>
<string name="Reacted_with">Reacciono con</string>
<!-- Sorting and grouping--> <!-- Sorting and grouping-->
<string name="menu_chatroom_sort">Ordenar</string> <string name="menu_chatroom_sort">Ordenar</string>
......
...@@ -286,9 +286,6 @@ ...@@ -286,9 +286,6 @@
<!-- Emoji message--> <!-- Emoji message-->
<string name="msg_no_recent_emoji">Aucun emoji récent</string> <string name="msg_no_recent_emoji">Aucun emoji récent</string>
<string name="alert_title_default_skin_tone">Tonalité de peau par défaut</string> <string name="alert_title_default_skin_tone">Tonalité de peau par défaut</string>
<string name="And_more">et encore %1$d</string>
<string name="and">et</string>
<string name="Reacted_with">a réagi avec</string>
<!-- Sorting and grouping--> <!-- Sorting and grouping-->
<string name="menu_chatroom_sort">Trier</string> <string name="menu_chatroom_sort">Trier</string>
......
...@@ -288,9 +288,6 @@ ...@@ -288,9 +288,6 @@
<!-- Emoji message--> <!-- Emoji message-->
<string name="msg_no_recent_emoji">最近の絵文字はありません</string> <string name="msg_no_recent_emoji">最近の絵文字はありません</string>
<string name="alert_title_default_skin_tone">デフォルトスキントークン</string> <string name="alert_title_default_skin_tone">デフォルトスキントークン</string>
<string name="And_more">さらに %1$d</string>
<string name="and"></string>
<string name="Reacted_with">がリアクションしています</string>
<!-- Sorting and grouping--> <!-- Sorting and grouping-->
<string name="menu_chatroom_sort">ソート</string> <string name="menu_chatroom_sort">ソート</string>
......
...@@ -283,9 +283,6 @@ ...@@ -283,9 +283,6 @@
<!-- Emoji message--> <!-- Emoji message-->
<string name="msg_no_recent_emoji">Nenhum emoji recente</string> <string name="msg_no_recent_emoji">Nenhum emoji recente</string>
<string name="alert_title_default_skin_tone">Tom de pele padrão</string> <string name="alert_title_default_skin_tone">Tom de pele padrão</string>
<string name="And_more">E mais %1$d</string>
<string name="and">e</string>
<string name="Reacted_with">Reagiu com</string>
<!-- Sorting and grouping--> <!-- Sorting and grouping-->
<string name="menu_chatroom_sort">Ordenar</string> <string name="menu_chatroom_sort">Ordenar</string>
......
...@@ -279,9 +279,6 @@ ...@@ -279,9 +279,6 @@
<!-- Emoji message--> <!-- Emoji message-->
<string name="msg_no_recent_emoji">Пусто</string> <string name="msg_no_recent_emoji">Пусто</string>
<string name="alert_title_default_skin_tone">Тон кожи по умолчанию</string> <string name="alert_title_default_skin_tone">Тон кожи по умолчанию</string>
<string name="And_more">И еще %1$d</string>
<string name="and">и</string>
<string name="Reacted_with">Реагирует с</string>
<!-- Sorting and grouping--> <!-- Sorting and grouping-->
<string name="menu_chatroom_sort">Сортировать</string> <string name="menu_chatroom_sort">Сортировать</string>
......
...@@ -285,9 +285,6 @@ ...@@ -285,9 +285,6 @@
<!-- Emoji message--> <!-- Emoji message-->
<string name="msg_no_recent_emoji">Son kullanılan emoji bulunmamaktadır</string> <string name="msg_no_recent_emoji">Son kullanılan emoji bulunmamaktadır</string>
<string name="alert_title_default_skin_tone">Varsayılan tasarım tonu</string> <string name="alert_title_default_skin_tone">Varsayılan tasarım tonu</string>
<string name="And_more">Ve %1$d kadar daha fazla</string>
<string name="and">ve</string>
<string name="Reacted_with">ile reaksiyona sokulur</string>
<!-- Sorting and grouping--> <!-- Sorting and grouping-->
<string name="menu_chatroom_sort">Sırala</string> <string name="menu_chatroom_sort">Sırala</string>
......
...@@ -282,9 +282,6 @@ ...@@ -282,9 +282,6 @@
<!-- Emoji message--> <!-- Emoji message-->
<string name="msg_no_recent_emoji">Пусто</string> <string name="msg_no_recent_emoji">Пусто</string>
<string name="alert_title_default_skin_tone">Тон шкіри за замовчуванням</string> <string name="alert_title_default_skin_tone">Тон шкіри за замовчуванням</string>
<string name="And_more">І ще %1$d</string>
<string name="and">і</string>
<string name="Reacted_with">реагує з</string>
<!-- Sorting and grouping--> <!-- Sorting and grouping-->
<string name="menu_chatroom_sort">Сортувати</string> <string name="menu_chatroom_sort">Сортувати</string>
......
...@@ -295,9 +295,7 @@ https://github.com/RocketChat/java-code-styles/blob/master/CODING_STYLE.md#strin ...@@ -295,9 +295,7 @@ https://github.com/RocketChat/java-code-styles/blob/master/CODING_STYLE.md#strin
<!-- Emoji message--> <!-- Emoji message-->
<string name="msg_no_recent_emoji">No recent emojis</string> <string name="msg_no_recent_emoji">No recent emojis</string>
<string name="alert_title_default_skin_tone">Default skin tone</string> <string name="alert_title_default_skin_tone">Default skin tone</string>
<string name="And_more">And %1$d more</string> <string name="alert_title_reactions_by">%1$s reactions by</string>
<string name="and">and</string>
<string name="Reacted_with">Reacted with</string>
<!-- Sorting and grouping--> <!-- Sorting and grouping-->
<string name="menu_chatroom_sort">Sort</string> <string name="menu_chatroom_sort">Sort</string>
......
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