Merge pull request #577 from RyanRory/bug-fix-1-11-22

Bug fix 1.11.22
This commit is contained in:
RyanZhao 2022-03-10 14:53:06 +11:00 committed by GitHub
commit 20f99df0be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 7 deletions

View File

@ -239,7 +239,6 @@ final class ConversationCell : UITableViewCell {
// Contact // Contact
if threadViewModel.isGroupThread, let thread = threadViewModel.threadRecord as? TSGroupThread { if threadViewModel.isGroupThread, let thread = threadViewModel.threadRecord as? TSGroupThread {
displayNameLabel.attributedText = getHighlightedSnippet(snippet: getDisplayName(), searchText: normalizedSearchText, fontSize: Values.mediumFontSize) displayNameLabel.attributedText = getHighlightedSnippet(snippet: getDisplayName(), searchText: normalizedSearchText, fontSize: Values.mediumFontSize)
bottomLabelStackView.isHidden = false
let context: Contact.Context = thread.isOpenGroup ? .openGroup : .regular let context: Contact.Context = thread.isOpenGroup ? .openGroup : .regular
var rawSnippet: String = "" var rawSnippet: String = ""
thread.groupModel.groupMemberIds.forEach{ id in thread.groupModel.groupMemberIds.forEach{ id in
@ -252,7 +251,12 @@ final class ConversationCell : UITableViewCell {
} }
} }
} }
snippetLabel.attributedText = getHighlightedSnippet(snippet: rawSnippet, searchText: normalizedSearchText, fontSize: Values.smallFontSize) if rawSnippet.isEmpty {
bottomLabelStackView.isHidden = true
} else {
bottomLabelStackView.isHidden = false
snippetLabel.attributedText = getHighlightedSnippet(snippet: rawSnippet, searchText: normalizedSearchText, fontSize: Values.smallFontSize)
}
} else { } else {
displayNameLabel.attributedText = getHighlightedSnippet(snippet: getDisplayNameForSearch(threadViewModel.contactSessionID!), searchText: normalizedSearchText, fontSize: Values.mediumFontSize) displayNameLabel.attributedText = getHighlightedSnippet(snippet: getDisplayNameForSearch(threadViewModel.contactSessionID!), searchText: normalizedSearchText, fontSize: Values.mediumFontSize)
bottomLabelStackView.isHidden = true bottomLabelStackView.isHidden = true

View File

@ -417,11 +417,7 @@ extension MessageReceiver {
// Use the same identifier for notifications when in backgroud polling to prevent spam // Use the same identifier for notifications when in backgroud polling to prevent spam
let notificationIdentifier = isBackgroundPoll ? thread.uniqueId : UUID().uuidString let notificationIdentifier = isBackgroundPoll ? thread.uniqueId : UUID().uuidString
tsIncomingMessage.setNotificationIdentifier(notificationIdentifier, transaction: transaction) tsIncomingMessage.setNotificationIdentifier(notificationIdentifier, transaction: transaction)
DispatchQueue.main.async { SSKEnvironment.shared.notificationsManager!.notifyUser(for: tsIncomingMessage, in: thread, transaction: transaction)
Storage.read { transaction in
SSKEnvironment.shared.notificationsManager!.notifyUser(for: tsIncomingMessage, in: thread, transaction: transaction)
}
}
return tsMessageID return tsMessageID
} }

View File

@ -86,6 +86,7 @@ public class NSENotificationPresenter: NSObject, NotificationsProtocol {
// If it's a message request then overwrite the body to be something generic (only show a notification // If it's a message request then overwrite the body to be something generic (only show a notification
// when receiving a new message request if there aren't any others or the user had hidden them) // when receiving a new message request if there aren't any others or the user had hidden them)
if thread.isMessageRequest() { if thread.isMessageRequest() {
notificationContent.title = "Session"
notificationContent.body = "MESSAGE_REQUESTS_NOTIFICATION".localized() notificationContent.body = "MESSAGE_REQUESTS_NOTIFICATION".localized()
} }