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
99304b36
Commit
99304b36
authored
May 07, 2018
by
Leonardo Aramaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add mute and unmute system messages
parent
e99671dc
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
0 deletions
+13
-0
ViewModelMapper.kt
...chat/rocket/android/chatroom/viewmodel/ViewModelMapper.kt
+3
-0
strings.xml
app/src/main/res/values-es/strings.xml
+2
-0
strings.xml
app/src/main/res/values-fr/strings.xml
+2
-0
strings.xml
app/src/main/res/values-hi-rIN/strings.xml
+2
-0
strings.xml
app/src/main/res/values-pt-rBR/strings.xml
+2
-0
strings.xml
app/src/main/res/values/strings.xml
+2
-0
No files found.
app/src/main/java/chat/rocket/android/chatroom/viewmodel/ViewModelMapper.kt
View file @
99304b36
...
@@ -313,6 +313,7 @@ class ViewModelMapper @Inject constructor(
...
@@ -313,6 +313,7 @@ class ViewModelMapper @Inject constructor(
}
}
private
fun
getSystemMessage
(
message
:
Message
):
CharSequence
{
private
fun
getSystemMessage
(
message
:
Message
):
CharSequence
{
println
(
message
)
val
content
=
when
(
message
.
type
)
{
val
content
=
when
(
message
.
type
)
{
//TODO: Add implementation for Welcome type.
//TODO: Add implementation for Welcome type.
is
MessageType
.
MessageRemoved
->
context
.
getString
(
R
.
string
.
message_removed
)
is
MessageType
.
MessageRemoved
->
context
.
getString
(
R
.
string
.
message_removed
)
...
@@ -322,6 +323,8 @@ class ViewModelMapper @Inject constructor(
...
@@ -322,6 +323,8 @@ class ViewModelMapper @Inject constructor(
is
MessageType
.
RoomNameChanged
->
context
.
getString
(
R
.
string
.
message_room_name_changed
,
message
.
message
,
message
.
sender
?.
username
)
is
MessageType
.
RoomNameChanged
->
context
.
getString
(
R
.
string
.
message_room_name_changed
,
message
.
message
,
message
.
sender
?.
username
)
is
MessageType
.
UserRemoved
->
context
.
getString
(
R
.
string
.
message_user_removed_by
,
message
.
message
,
message
.
sender
?.
username
)
is
MessageType
.
UserRemoved
->
context
.
getString
(
R
.
string
.
message_user_removed_by
,
message
.
message
,
message
.
sender
?.
username
)
is
MessageType
.
MessagePinned
->
context
.
getString
(
R
.
string
.
message_pinned
)
is
MessageType
.
MessagePinned
->
context
.
getString
(
R
.
string
.
message_pinned
)
is
MessageType
.
UserMuted
->
context
.
getString
(
R
.
string
.
message_muted
,
message
.
message
,
message
.
sender
?.
username
)
is
MessageType
.
UserUnMuted
->
context
.
getString
(
R
.
string
.
message_unmuted
,
message
.
message
,
message
.
sender
?.
username
)
else
->
{
else
->
{
throw
InvalidParameterException
(
"Invalid message type: ${message.type}"
)
throw
InvalidParameterException
(
"Invalid message type: ${message.type}"
)
}
}
...
...
app/src/main/res/values-es/strings.xml
View file @
99304b36
...
@@ -121,6 +121,8 @@
...
@@ -121,6 +121,8 @@
<string
name=
"message_welcome"
>
Bienvenido %s
</string>
<string
name=
"message_welcome"
>
Bienvenido %s
</string>
<string
name=
"message_removed"
>
Mensaje eliminado
</string>
<string
name=
"message_removed"
>
Mensaje eliminado
</string>
<string
name=
"message_pinned"
>
Fijado una mensaje:
</string>
<string
name=
"message_pinned"
>
Fijado una mensaje:
</string>
<string
name=
"message_muted"
>
Usuario %1$s silenciado por %2$s
</string>
<string
name=
"message_unmuted"
>
Usuario %1$s no silenciado por %2$s
</string>
<!-- Message actions -->
<!-- Message actions -->
<string
name=
"action_msg_reply"
>
Respuesta
</string>
<string
name=
"action_msg_reply"
>
Respuesta
</string>
...
...
app/src/main/res/values-fr/strings.xml
View file @
99304b36
...
@@ -121,6 +121,8 @@
...
@@ -121,6 +121,8 @@
<string
name=
"message_welcome"
>
Bienvenue %s
</string>
<string
name=
"message_welcome"
>
Bienvenue %s
</string>
<string
name=
"message_removed"
>
Message supprimé
</string>
<string
name=
"message_removed"
>
Message supprimé
</string>
<string
name=
"message_pinned"
>
Épinglé un message:
</string>
<string
name=
"message_pinned"
>
Épinglé un message:
</string>
<string
name=
"message_muted"
>
Utilisateur %1$s mis en sourdine par %2$s
</string>
<string
name=
"message_unmuted"
>
Utilisateur %1$s non muté par %2$s
</string>
<!-- Message actions -->
<!-- Message actions -->
<string
name=
"action_msg_reply"
>
Répondre
</string>
<string
name=
"action_msg_reply"
>
Répondre
</string>
...
...
app/src/main/res/values-hi-rIN/strings.xml
View file @
99304b36
...
@@ -123,6 +123,8 @@
...
@@ -123,6 +123,8 @@
<string
name=
"message_welcome"
>
%s का स्वागत करते हैं
</string>
<string
name=
"message_welcome"
>
%s का स्वागत करते हैं
</string>
<string
name=
"message_removed"
>
संदेश हटाया गया
</string>
<string
name=
"message_removed"
>
संदेश हटाया गया
</string>
<string
name=
"message_pinned"
>
एक संदेश पिन किया:
</string>
<string
name=
"message_pinned"
>
एक संदेश पिन किया:
</string>
<string
name=
"message_muted"
>
उपयोगकर्ता %1$s %2$s द्वारा म्यूट किया गया
</string>
<string
name=
"message_unmuted"
>
उपयोगकर्ता %1$s %2$s द्वारा अनम्यूट किया गया
</string>
<!-- Message actions -->
<!-- Message actions -->
<string
name=
"action_msg_reply"
>
जवाब दें
</string>
<string
name=
"action_msg_reply"
>
जवाब दें
</string>
...
...
app/src/main/res/values-pt-rBR/strings.xml
View file @
99304b36
...
@@ -117,6 +117,8 @@
...
@@ -117,6 +117,8 @@
<string
name=
"message_welcome"
>
Bem-vindo, %s
</string>
<string
name=
"message_welcome"
>
Bem-vindo, %s
</string>
<string
name=
"message_removed"
>
Mensagem removida
</string>
<string
name=
"message_removed"
>
Mensagem removida
</string>
<string
name=
"message_pinned"
>
Pinou uma mensagem:
</string>
<string
name=
"message_pinned"
>
Pinou uma mensagem:
</string>
<string
name=
"message_muted"
>
Usuário %1$s silenciado por %2$s
</string>
<string
name=
"message_unmuted"
>
Usuário %1$s de-silenciado por %2$s
</string>
<!-- Message actions -->
<!-- Message actions -->
<string
name=
"action_msg_reply"
>
Responder
</string>
<string
name=
"action_msg_reply"
>
Responder
</string>
...
...
app/src/main/res/values/strings.xml
View file @
99304b36
...
@@ -118,6 +118,8 @@
...
@@ -118,6 +118,8 @@
<string
name=
"message_welcome"
>
Welcome %s
</string>
<string
name=
"message_welcome"
>
Welcome %s
</string>
<string
name=
"message_removed"
>
Message removed
</string>
<string
name=
"message_removed"
>
Message removed
</string>
<string
name=
"message_pinned"
>
Pinned a message:
</string>
<string
name=
"message_pinned"
>
Pinned a message:
</string>
<string
name=
"message_muted"
>
User %1$s muted by %2$s
</string>
<string
name=
"message_unmuted"
>
User %1$s unmuted by %2$s
</string>
<!-- Message actions -->
<!-- Message actions -->
<string
name=
"action_msg_reply"
>
Reply
</string>
<string
name=
"action_msg_reply"
>
Reply
</string>
...
...
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