Skip to content

Commit a3c77d2

Browse files
committed
fix large file attachments
1 parent f2a9d22 commit a3c77d2

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

app/src/main/java/co/tinode/tindroid/MessageActivity.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -327,29 +327,29 @@ boolean changeTopic(String topicName, boolean forceReset) {
327327
nm.cancel(topicName, 0);
328328
}
329329

330-
final Tinode tinode = Cache.getTinode();
331-
ComTopic<VxCard> topic;
332-
try {
333-
//noinspection unchecked
334-
topic = (ComTopic<VxCard>) tinode.getTopic(topicName);
335-
} catch (ClassCastException ex) {
336-
Log.w(TAG, "Failed to switch topics: non-comm topic");
337-
return false;
338-
}
330+
boolean changed = false;
331+
if (mTopicName == null || !mTopicName.equals(topicName) || forceReset) {
332+
final Tinode tinode = Cache.getTinode();
333+
ComTopic<VxCard> topic;
334+
try {
335+
//noinspection unchecked
336+
topic = (ComTopic<VxCard>) tinode.getTopic(topicName);
337+
} catch (ClassCastException ex) {
338+
Log.w(TAG, "Failed to switch topics: non-comm topic");
339+
return false;
340+
}
339341

340-
if (mTopic != null) {
341-
topicDetach(mTopic);
342-
}
342+
changed = true;
343+
if (mTopic != null) {
344+
topicDetach(mTopic);
345+
}
343346

344-
mTopic = topic;
345-
boolean changed = false;
347+
mTopic = topic;
346348

347-
if (mTopicName == null || !mTopicName.equals(topicName)) {
348349
Cache.setSelectedTopicName(topicName);
349350
mTopicName = topicName;
350351

351352
mPinHash = -1;
352-
changed = true;
353353
if (mTopic == null) {
354354
UiUtils.setupToolbar(this, null,
355355
mTopicName, false, null, false, 0);

0 commit comments

Comments
 (0)