Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xabber-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
xabber-android
Commits
2075538c
You need to sign in or sign up before continuing.
Commit
2075538c
authored
Jun 05, 2015
by
Grigory Fedorov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RegularChat: empty messages dropped as service messages.
parent
ec27bb55
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
12 deletions
+13
-12
RegularChat.java
...ain/java/com/xabber/android/data/message/RegularChat.java
+10
-11
ChatMessageAdapter.java
...ava/com/xabber/android/ui/adapter/ChatMessageAdapter.java
+3
-1
No files found.
app/src/main/java/com/xabber/android/data/message/RegularChat.java
View file @
2075538c
...
...
@@ -14,14 +14,6 @@
*/
package
com
.
xabber
.
android
.
data
.
message
;
import
net.java.otr4j.OtrException
;
import
org.jivesoftware.smack.packet.Message
;
import
org.jivesoftware.smack.packet.Message.Type
;
import
org.jivesoftware.smack.packet.Packet
;
import
org.jivesoftware.smack.packet.Presence
;
import
org.jivesoftware.smackx.packet.MUCUser
;
import
com.xabber.android.data.LogManager
;
import
com.xabber.android.data.NetworkException
;
import
com.xabber.android.data.SettingsManager
;
...
...
@@ -35,6 +27,14 @@ import com.xabber.xmpp.archive.SaveMode;
import
com.xabber.xmpp.delay.Delay
;
import
com.xabber.xmpp.muc.MUC
;
import
net.java.otr4j.OtrException
;
import
org.jivesoftware.smack.packet.Message
;
import
org.jivesoftware.smack.packet.Message.Type
;
import
org.jivesoftware.smack.packet.Packet
;
import
org.jivesoftware.smack.packet.Presence
;
import
org.jivesoftware.smackx.packet.MUCUser
;
/**
* Represents normal chat.
*
...
...
@@ -141,8 +141,7 @@ public class RegularChat extends AbstractChat {
updateThreadId
(
thread
);
boolean
unencrypted
=
false
;
try
{
text
=
OTRManager
.
getInstance
().
transformReceiving
(
account
,
user
,
text
);
text
=
OTRManager
.
getInstance
().
transformReceiving
(
account
,
user
,
text
);
}
catch
(
OtrException
e
)
{
if
(
e
.
getCause
()
instanceof
OTRUnencryptedException
)
{
text
=
((
OTRUnencryptedException
)
e
.
getCause
()).
getText
();
...
...
@@ -154,7 +153,7 @@ public class RegularChat extends AbstractChat {
}
}
// System message received.
if
(
text
==
null
)
if
(
text
==
null
||
text
.
trim
().
equals
(
""
)
)
return
true
;
if
(!
""
.
equals
(
resource
))
this
.
resource
=
resource
;
...
...
app/src/main/java/com/xabber/android/ui/adapter/ChatMessageAdapter.java
View file @
2075538c
...
...
@@ -23,6 +23,7 @@ import android.widget.ImageView;
import
android.widget.TextView
;
import
com.xabber.android.R
;
import
com.xabber.android.data.LogManager
;
import
com.xabber.android.data.SettingsManager
;
import
com.xabber.android.data.account.AccountItem
;
import
com.xabber.android.data.account.AccountManager
;
...
...
@@ -139,6 +140,7 @@ public class ChatMessageAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
incomingMessage
.
messageBalloon
.
setVisibility
(
View
.
GONE
);
incomingMessage
.
messageTime
.
setVisibility
(
View
.
GONE
);
incomingMessage
.
avatar
.
setVisibility
(
View
.
GONE
);
LogManager
.
w
(
this
,
"Empty message! Hidden, but need to correct"
);
}
else
{
incomingMessage
.
messageBalloon
.
setVisibility
(
View
.
VISIBLE
);
incomingMessage
.
messageTime
.
setVisibility
(
View
.
VISIBLE
);
...
...
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