forked from mirror/monocles_chat_clean
only overwrite body in text messages
(cherry picked from commit aaac8296b324e422711e3c5fb315ab8ee81841b0)
This commit is contained in:
parent
e346c6bb60
commit
081469e171
4 changed files with 10 additions and 2 deletions
|
@ -971,6 +971,11 @@ public class Message extends AbstractEntity implements AvatarService.Avatarable
|
|||
return type == TYPE_FILE || type == TYPE_IMAGE || type == TYPE_PRIVATE_FILE;
|
||||
}
|
||||
|
||||
|
||||
public boolean isTypeText() {
|
||||
return type == TYPE_TEXT || type == TYPE_PRIVATE;
|
||||
}
|
||||
|
||||
public boolean hasFileOnRemoteHost() {
|
||||
return isFileOrImage() && getFileParams().url != null;
|
||||
}
|
||||
|
|
|
@ -377,6 +377,7 @@ public class HttpDownloadConnection implements Transferable {
|
|||
changeStatus(STATUS_OFFER);
|
||||
} catch (final Exception e) {
|
||||
Log.d(Config.LOGTAG,"problem downloading",e);
|
||||
//TODO do not show toast for cancelled stuff
|
||||
if (interactive) {
|
||||
showToastForException(e);
|
||||
} else {
|
||||
|
|
|
@ -68,7 +68,7 @@ public class ChannelDiscoveryService {
|
|||
}
|
||||
|
||||
void discover(@NonNull final String query, Method method, OnChannelSearchResultsFound onChannelSearchResultsFound) {
|
||||
List<Room> result = cache.getIfPresent(key(method, query));
|
||||
final List<Room> result = cache.getIfPresent(key(method, query));
|
||||
if (result != null) {
|
||||
onChannelSearchResultsFound.onChannelSearchResultsFound(result);
|
||||
return;
|
||||
|
|
|
@ -4304,7 +4304,9 @@ public class XmppConnectionService extends Service {
|
|||
if (message.getServerMsgId() == null) {
|
||||
message.setServerMsgId(serverMessageId);
|
||||
}
|
||||
if (message.getEncryption() == Message.ENCRYPTION_NONE && isBodyModified(message, body) && !message.isFileOrImage()) {
|
||||
if (message.getEncryption() == Message.ENCRYPTION_NONE
|
||||
&& message.isTypeText()
|
||||
&& isBodyModified(message, body)) {
|
||||
message.setBody(body.content);
|
||||
if (body.count > 1) {
|
||||
message.setBodyLanguage(body.language);
|
||||
|
|
Loading…
Add table
Reference in a new issue