diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1fd8992 --- /dev/null +++ b/.gitignore @@ -0,0 +1,32 @@ +### Android template +# Built application files +*.apk +*.ap_ + +# Files for the Dalvik VM +*.dex + +# Java class files +*.class + +# Generated files +bin/ +gen/ + +# Gradle files +.gradle/ +build/ + +# Local configuration file (sdk path, etc) +local.properties + +# Proguard folder generated by Eclipse +proguard/ + +# Log Files +*.log + +# Android Studio Navigation editor temp files +.navigation/ + +# Created by .ignore support plugin (hsz.mobi) diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..8d2df47 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,18 @@ + + + + + + \ No newline at end of file diff --git a/.idea/libraries/appcompat_v7_23_0_1.xml b/.idea/libraries/appcompat_v7_23_0_1.xml new file mode 100644 index 0000000..91e40f4 --- /dev/null +++ b/.idea/libraries/appcompat_v7_23_0_1.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/gradle_wrapper.xml b/.idea/libraries/gradle_wrapper.xml deleted file mode 100644 index c5ef1a1..0000000 --- a/.idea/libraries/gradle_wrapper.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/json_simple_1_1.xml b/.idea/libraries/json_simple_1_1.xml new file mode 100644 index 0000000..bd262a8 --- /dev/null +++ b/.idea/libraries/json_simple_1_1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/messaging_android_2_1_56.xml b/.idea/libraries/messaging_android_2_1_56.xml new file mode 100644 index 0000000..4617128 --- /dev/null +++ b/.idea/libraries/messaging_android_2_1_56.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/play_services_6_1_71.xml b/.idea/libraries/play_services_6_1_71.xml new file mode 100644 index 0000000..11a9be7 --- /dev/null +++ b/.idea/libraries/play_services_6_1_71.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/support_annotations_23_0_1.xml b/.idea/libraries/support_annotations_23_0_1.xml new file mode 100644 index 0000000..4b8b4ab --- /dev/null +++ b/.idea/libraries/support_annotations_23_0_1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/support_v4_23_0_1.xml b/.idea/libraries/support_v4_23_0_1.xml new file mode 100644 index 0000000..0bc367b --- /dev/null +++ b/.idea/libraries/support_v4_23_0_1.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 98364ff..c469053 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,5 +1,32 @@ + + + + + + + @@ -10,7 +37,7 @@ - + diff --git a/.idea/modules.xml b/.idea/modules.xml index 52b8cb3..139a8c0 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -2,8 +2,8 @@ - - + + \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml new file mode 100644 index 0000000..7f68460 --- /dev/null +++ b/.idea/runConfigurations.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 35eb1dd..8306744 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -2,5 +2,6 @@ + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 4c27b29..c9de7ba 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,8 +5,16 @@ + + - + + + + + + @@ -22,16 +30,23 @@ + + + + + + + - - + + - - + + @@ -43,10 +58,1463 @@ + + + + + + + @@ -79,8 +1547,6 @@ - - @@ -123,7 +1589,7 @@ - + @@ -137,38 +1603,30 @@ - - - - - + + + + + + - + + + + + + + - - + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + diff --git a/app/src/main/java/handlers/OrtcHandler.java b/app/src/main/java/handlers/OrtcHandler.java index 18bf50e..0bca1b9 100644 --- a/app/src/main/java/handlers/OrtcHandler.java +++ b/app/src/main/java/handlers/OrtcHandler.java @@ -141,10 +141,16 @@ public void sendMsg(Message msg, String channel) { OrtcHandler.client.send(channel, msg.toString()); } - public void handleMessage(String msg, String channel){ - String[] parts = msg.split(":"); + public void handleMessage(String msg, String channel){ SimpleDateFormat sdf = new SimpleDateFormat(Config.DATE_FORMAT); - Message newMsg = new Message(parts[0], parts[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); @@ -155,6 +161,7 @@ public void handleMessage(String msg, String channel){ if(chatRoom != null) chatRoom.refreshData(newMsg); + } } diff --git a/build/intermediates/dex-cache/cache.xml b/build/intermediates/dex-cache/cache.xml index 83f550d..a57c21b 100644 --- a/build/intermediates/dex-cache/cache.xml +++ b/build/intermediates/dex-cache/cache.xml @@ -2,18 +2,53 @@ - + + + + + + + + + + + + + - + + + + diff --git a/local.properties b/local.properties deleted file mode 100644 index c1d177c..0000000 --- a/local.properties +++ /dev/null @@ -1,11 +0,0 @@ -## This file is automatically generated by Android Studio. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must *NOT* be checked into Version Control Systems, -# as it contains information specific to your local configuration. -# -# Location of the SDK. This is only used by Gradle. -# For customization when using a Version Control System, please read the -# header note. -#Wed Oct 07 12:17:20 WEST 2015 -sdk.dir=/Users/admin/Library/Android/sdk