Skip to content

Commit

Permalink
Accept messages from unknown user
Browse files Browse the repository at this point in the history
  • Loading branch information
tcruzibt committed Oct 7, 2015
1 parent 5b62bb9 commit af2e077
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/src/main/java/handlers/OrtcHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,14 @@ public void sendMsg(Message msg, String channel) {

public void handleMessage(String msg, String channel){
SimpleDateFormat sdf = new SimpleDateFormat(Config.DATE_FORMAT);
Message newMsg = new Message(msg.substring(0,msg.indexOf(":")), msg.substring(msg.indexOf(":")+1),sdf.format(new Date()));
Message newMsg = null;
if(msg.contains(":"))
{
newMsg = new Message(msg.substring(0, msg.indexOf(":")), msg.substring(msg.indexOf(":") + 1), sdf.format(new Date()));
}
else {
newMsg = new Message("Unknown user", msg, sdf.format(new Date()));
}

Channel list = messages.get(channel);
list.setUnRead(list.getUnRead() + 1);
Expand All @@ -154,6 +161,7 @@ public void handleMessage(String msg, String channel){

if(chatRoom != null)
chatRoom.refreshData(newMsg);

}

}

0 comments on commit af2e077

Please sign in to comment.