Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/quite/humla.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Lublin <daniel@lublin.se>2020-06-02 00:23:58 +0300
committerDaniel Lublin <daniel@lublin.se>2020-06-02 00:23:58 +0300
commit6584640d2834ee80f0939faaa46eda97a1043a0b (patch)
treefbb438ee379b140218e50b6e64729250a753733f
parent30e3a5c3944a315d6286f453dfbc331092ea545e (diff)
Clear actual comment when we receive a hash, and vice versa
Fixes issue with >128 byte (hashed) comment not being fetched, due to the old shorter comment still laying around. Possibly other issues as well.
-rw-r--r--src/main/java/se/lublin/humla/protocol/ModelHandler.java17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/main/java/se/lublin/humla/protocol/ModelHandler.java b/src/main/java/se/lublin/humla/protocol/ModelHandler.java
index fa3ccfc..04a7a8b 100644
--- a/src/main/java/se/lublin/humla/protocol/ModelHandler.java
+++ b/src/main/java/se/lublin/humla/protocol/ModelHandler.java
@@ -137,11 +137,15 @@ public class ModelHandler extends HumlaTCPMessageListener.Stub {
}
}
- if(msg.hasDescriptionHash())
+ if(msg.hasDescriptionHash()) {
channel.setDescriptionHash(msg.getDescriptionHash().toByteArray());
+ channel.setDescription(null);
+ }
- if(msg.hasDescription())
+ if(msg.hasDescription()) {
channel.setDescription(msg.getDescription());
+ channel.setDescriptionHash(null);
+ }
if(msg.getLinksCount() > 0) {
channel.clearLinks();
@@ -382,13 +386,18 @@ public class ModelHandler extends HumlaTCPMessageListener.Stub {
if (msg.hasTexture()) {
// FIXME: is it reasonable to create a bitmap here? How expensive?
user.setTexture(msg.getTexture());
+ user.setTextureHash(null);
}
- if(msg.hasCommentHash())
+ if(msg.hasCommentHash()) {
user.setCommentHash(msg.getCommentHash());
+ user.setComment(null);
+ }
- if(msg.hasComment())
+ if(msg.hasComment()) {
user.setComment(msg.getComment());
+ user.setCommentHash(null);
+ }
if (newUser)
mObserver.onUserConnected(user);