Fixed issue where new closed groups would display a timestamp instead of the 'groupNoMessages' text

This commit is contained in:
Al Lansley 2024-08-15 12:13:30 +10:00
parent 51ef0ec81c
commit 90d7064c18
3 changed files with 17 additions and 3 deletions

View File

@ -1096,6 +1096,8 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
val blindedRecipient = viewModel.blindedRecipient
val openGroup = viewModel.openGroup
val isClosedGroup = recipient.isGroupRecipient
// Get the correct placeholder text for this type of empty conversation
val isNoteToSelf = recipient.isLocalNumber
val txtCS: CharSequence = when {
@ -1115,12 +1117,17 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
.format()
}
else -> {
recipient.isGroupRecipient -> {
// If this is a group or community that we CAN send messages to
Phrase.from(applicationContext, R.string.groupNoMessages)
.put(GROUP_NAME_KEY, recipient.toShortString())
.format()
}
else -> {
Log.w(TAG, "Something else happened in updatePlaceholder - we're not sure what.")
""
}
}
val showPlaceholder = adapter.itemCount == 0

View File

@ -633,7 +633,11 @@ open class Storage(
// Notify the user
val threadID = getOrCreateThreadIdFor(Address.fromSerialized(groupId))
threadDb.setDate(threadID, formationTimestamp)
insertOutgoingInfoMessage(context, groupId, SignalServiceGroup.Type.CREATION, title, members.map { it.serialize() }, admins.map { it.serialize() }, threadID, formationTimestamp)
// ACL Note: Commenting out this line prevents the timestamp of room creation being added to a new closed group,
// which in turn allows us to show the `groupNoMessages` control message text.
//insertOutgoingInfoMessage(context, groupId, SignalServiceGroup.Type.CREATION, title, members.map { it.serialize() }, admins.map { it.serialize() }, threadID, formationTimestamp)
// Don't create config group here, it's from a config update
// Start polling
ClosedGroupPollerV2.shared.startPolling(group.accountId)

View File

@ -70,7 +70,10 @@ fun MessageSender.create(
// Notify the user
val threadID = storage.getOrCreateThreadIdFor(Address.fromSerialized(groupID))
storage.insertOutgoingInfoMessage(context, groupID, SignalServiceGroup.Type.CREATION, name, members, admins, threadID, sentTime)
// ACL Note: Commenting out this line prevents the timestamp of room creation being added to a new closed group,
// which in turn allows us to show the `groupNoMessages` control message text.
//storage.insertOutgoingInfoMessage(context, groupID, SignalServiceGroup.Type.CREATION, name, members, admins, threadID, sentTime)
val ourPubKey = storage.getUserPublicKey()
for (member in members) {