|
|
@ -90,6 +90,7 @@ import org.session.libsession.messaging.messages.signal.OutgoingSecureMediaMessa
|
|
|
|
import org.session.libsession.messaging.messages.signal.OutgoingTextMessage;
|
|
|
|
import org.session.libsession.messaging.messages.signal.OutgoingTextMessage;
|
|
|
|
import org.session.libsession.messaging.messages.visible.VisibleMessage;
|
|
|
|
import org.session.libsession.messaging.messages.visible.VisibleMessage;
|
|
|
|
import org.session.libsession.messaging.open_groups.OpenGroup;
|
|
|
|
import org.session.libsession.messaging.open_groups.OpenGroup;
|
|
|
|
|
|
|
|
import org.session.libsession.messaging.open_groups.OpenGroupV2;
|
|
|
|
import org.session.libsession.messaging.sending_receiving.MessageSender;
|
|
|
|
import org.session.libsession.messaging.sending_receiving.MessageSender;
|
|
|
|
import org.session.libsession.messaging.sending_receiving.attachments.Attachment;
|
|
|
|
import org.session.libsession.messaging.sending_receiving.attachments.Attachment;
|
|
|
|
import org.session.libsession.messaging.sending_receiving.link_preview.LinkPreview;
|
|
|
|
import org.session.libsession.messaging.sending_receiving.link_preview.LinkPreview;
|
|
|
@ -374,9 +375,12 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|
|
|
MentionManagerUtilities.INSTANCE.populateUserPublicKeyCacheIfNeeded(threadId, this);
|
|
|
|
MentionManagerUtilities.INSTANCE.populateUserPublicKeyCacheIfNeeded(threadId, this);
|
|
|
|
|
|
|
|
|
|
|
|
OpenGroup publicChat = DatabaseFactory.getLokiThreadDatabase(this).getPublicChat(threadId);
|
|
|
|
OpenGroup publicChat = DatabaseFactory.getLokiThreadDatabase(this).getPublicChat(threadId);
|
|
|
|
|
|
|
|
OpenGroupV2 openGroupV2 = DatabaseFactory.getLokiThreadDatabase(this).getOpenGroupChat(threadId);
|
|
|
|
if (publicChat != null) {
|
|
|
|
if (publicChat != null) {
|
|
|
|
// Request open group info update and handle the successful result in #onOpenGroupInfoUpdated().
|
|
|
|
// Request open group info update and handle the successful result in #onOpenGroupInfoUpdated().
|
|
|
|
PublicChatInfoUpdateWorker.scheduleInstant(this, publicChat.getServer(), publicChat.getChannel());
|
|
|
|
PublicChatInfoUpdateWorker.scheduleInstant(this, publicChat.getServer(), publicChat.getChannel());
|
|
|
|
|
|
|
|
} else if (openGroupV2 != null) {
|
|
|
|
|
|
|
|
PublicChatInfoUpdateWorker.scheduleInstant(this, openGroupV2.getServer(), openGroupV2.getRoom());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
View rootView = findViewById(R.id.rootView);
|
|
|
|
View rootView = findViewById(R.id.rootView);
|
|
|
@ -1397,11 +1401,17 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|
|
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
|
|
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
|
|
|
public void onOpenGroupInfoUpdated(OpenGroupUtilities.GroupInfoUpdatedEvent event) {
|
|
|
|
public void onOpenGroupInfoUpdated(OpenGroupUtilities.GroupInfoUpdatedEvent event) {
|
|
|
|
OpenGroup publicChat = DatabaseFactory.getLokiThreadDatabase(this).getPublicChat(threadId);
|
|
|
|
OpenGroup publicChat = DatabaseFactory.getLokiThreadDatabase(this).getPublicChat(threadId);
|
|
|
|
|
|
|
|
OpenGroupV2 openGroup = DatabaseFactory.getLokiThreadDatabase(this).getOpenGroupChat(threadId);
|
|
|
|
if (publicChat != null &&
|
|
|
|
if (publicChat != null &&
|
|
|
|
publicChat.getChannel() == event.getChannel() &&
|
|
|
|
publicChat.getChannel() == event.getChannel() &&
|
|
|
|
publicChat.getServer().equals(event.getUrl())) {
|
|
|
|
publicChat.getServer().equals(event.getUrl())) {
|
|
|
|
this.updateSubtitleTextView();
|
|
|
|
this.updateSubtitleTextView();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (openGroup != null &&
|
|
|
|
|
|
|
|
openGroup.getRoom().equals(event.getRoom()) &&
|
|
|
|
|
|
|
|
openGroup.getServer().equals(event.getUrl())) {
|
|
|
|
|
|
|
|
this.updateSubtitleTextView();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//////// Helper Methods
|
|
|
|
//////// Helper Methods
|
|
|
@ -2335,10 +2345,15 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|
|
|
subtitleTextView.setText("Muted until " + DateUtils.getFormattedDateTime(recipient.mutedUntil, "EEE, MMM d, yyyy HH:mm", Locale.getDefault()));
|
|
|
|
subtitleTextView.setText("Muted until " + DateUtils.getFormattedDateTime(recipient.mutedUntil, "EEE, MMM d, yyyy HH:mm", Locale.getDefault()));
|
|
|
|
} else if (recipient.isGroupRecipient() && recipient.getName() != null && !recipient.getName().equals("Session Updates") && !recipient.getName().equals("Loki News")) {
|
|
|
|
} else if (recipient.isGroupRecipient() && recipient.getName() != null && !recipient.getName().equals("Session Updates") && !recipient.getName().equals("Loki News")) {
|
|
|
|
OpenGroup publicChat = DatabaseFactory.getLokiThreadDatabase(this).getPublicChat(threadId);
|
|
|
|
OpenGroup publicChat = DatabaseFactory.getLokiThreadDatabase(this).getPublicChat(threadId);
|
|
|
|
|
|
|
|
OpenGroupV2 openGroup = DatabaseFactory.getLokiThreadDatabase(this).getOpenGroupChat(threadId);
|
|
|
|
if (publicChat != null) {
|
|
|
|
if (publicChat != null) {
|
|
|
|
Integer userCount = DatabaseFactory.getLokiAPIDatabase(this).getUserCount(publicChat.getChannel(), publicChat.getServer());
|
|
|
|
Integer userCount = DatabaseFactory.getLokiAPIDatabase(this).getUserCount(publicChat.getChannel(), publicChat.getServer());
|
|
|
|
if (userCount == null) { userCount = 0; }
|
|
|
|
if (userCount == null) { userCount = 0; }
|
|
|
|
subtitleTextView.setText(userCount + " members");
|
|
|
|
subtitleTextView.setText(userCount + " members");
|
|
|
|
|
|
|
|
} else if (openGroup != null) {
|
|
|
|
|
|
|
|
Integer userCount = DatabaseFactory.getLokiAPIDatabase(this).getUserCount(openGroup.getRoom(),openGroup.getServer());
|
|
|
|
|
|
|
|
if (userCount == null) { userCount = 0; }
|
|
|
|
|
|
|
|
subtitleTextView.setText(userCount + " members");
|
|
|
|
} else if (PublicKeyValidation.isValid(recipient.getAddress().toString())) {
|
|
|
|
} else if (PublicKeyValidation.isValid(recipient.getAddress().toString())) {
|
|
|
|
subtitleTextView.setText(recipient.getAddress().toString());
|
|
|
|
subtitleTextView.setText(recipient.getAddress().toString());
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|