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
f2e8ba00
Commit
f2e8ba00
authored
Dec 19, 2016
by
Yusuke Iwaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix NPE
parent
3f049ecb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
MessageType.java
...hat/rocket/android/layouthelper/chatroom/MessageType.java
+12
-4
No files found.
app/src/main/java/chat/rocket/android/layouthelper/chatroom/MessageType.java
View file @
f2e8ba00
...
@@ -13,21 +13,21 @@ public enum MessageType {
...
@@ -13,21 +13,21 @@ public enum MessageType {
@Override
@Override
public
String
getString
(
Context
context
,
Message
message
)
{
public
String
getString
(
Context
context
,
Message
message
)
{
return
context
.
getString
(
R
.
string
.
message_room_name_changed
,
return
context
.
getString
(
R
.
string
.
message_room_name_changed
,
message
.
getMessage
(),
message
.
getUser
().
getUsername
(
));
message
.
getMessage
(),
getUsername
(
message
));
}
}
},
},
USER_ADDED
(
"au"
)
{
USER_ADDED
(
"au"
)
{
@Override
@Override
public
String
getString
(
Context
context
,
Message
message
)
{
public
String
getString
(
Context
context
,
Message
message
)
{
return
context
.
getString
(
R
.
string
.
message_user_added_by
,
return
context
.
getString
(
R
.
string
.
message_user_added_by
,
message
.
getMessage
(),
message
.
getUser
().
getUsername
(
));
message
.
getMessage
(),
getUsername
(
message
));
}
}
},
},
USER_REMOVED
(
"ru"
)
{
USER_REMOVED
(
"ru"
)
{
@Override
@Override
public
String
getString
(
Context
context
,
Message
message
)
{
public
String
getString
(
Context
context
,
Message
message
)
{
return
context
.
getString
(
R
.
string
.
message_user_removed_by
,
return
context
.
getString
(
R
.
string
.
message_user_removed_by
,
message
.
getMessage
(),
message
.
getUser
().
getUsername
(
));
message
.
getMessage
(),
getUsername
(
message
));
}
}
},
},
USER_JOINED
(
"uj"
)
{
USER_JOINED
(
"uj"
)
{
...
@@ -45,7 +45,7 @@ public enum MessageType {
...
@@ -45,7 +45,7 @@ public enum MessageType {
WELCOME
(
"wm"
)
{
WELCOME
(
"wm"
)
{
@Override
@Override
public
String
getString
(
Context
context
,
Message
message
)
{
public
String
getString
(
Context
context
,
Message
message
)
{
return
context
.
getString
(
R
.
string
.
message_welcome
,
message
.
getUser
().
getUsername
(
));
return
context
.
getString
(
R
.
string
.
message_welcome
,
getUsername
(
message
));
}
}
},
},
MESSAGE_REMOVED
(
"rm"
)
{
MESSAGE_REMOVED
(
"rm"
)
{
...
@@ -77,4 +77,12 @@ public enum MessageType {
...
@@ -77,4 +77,12 @@ public enum MessageType {
public
String
getString
(
Context
context
,
Message
message
)
{
public
String
getString
(
Context
context
,
Message
message
)
{
return
""
;
return
""
;
}
}
private
static
String
getUsername
(
Message
message
)
{
if
(
message
!=
null
&&
message
.
getUser
()
!=
null
)
{
return
message
.
getUser
().
getUsername
();
}
else
{
return
""
;
}
}
}
}
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