Debug
This commit is contained in:
parent
5e40221936
commit
b87ab79c5b
|
@ -134,17 +134,18 @@ final class ConversationCell : UITableViewCell {
|
|||
|
||||
// MARK: Updating
|
||||
private func update() {
|
||||
AssertIsOnMainThread()
|
||||
MentionsManager.populateUserPublicKeyCacheIfNeeded(for: threadViewModel.threadRecord.uniqueId!) // FIXME: This is a terrible place to do this
|
||||
unreadMessagesIndicatorView.alpha = threadViewModel.hasUnreadMessages ? 1 : 0.0001 // Setting the alpha to exactly 0 causes an issue on iOS 12
|
||||
profilePictureView.openGroupProfilePicture = nil
|
||||
if threadViewModel.isGroupThread {
|
||||
if threadViewModel.name == "Session Public Chat" {
|
||||
if threadViewModel.name == "Loki Public Chat" {
|
||||
profilePictureView.hexEncodedPublicKey = ""
|
||||
profilePictureView.isRSSFeed = true
|
||||
} else {
|
||||
if let openGroupProfilePicture = (threadViewModel.threadRecord as! TSGroupThread).groupModel.groupImage {
|
||||
profilePictureView.openGroupProfilePicture = openGroupProfilePicture
|
||||
} else {
|
||||
profilePictureView.openGroupProfilePicture = nil
|
||||
var users = MentionsManager.userPublicKeyCache[threadViewModel.threadRecord.uniqueId!] ?? []
|
||||
users.remove(getUserHexEncodedPublicKey())
|
||||
let randomUsers = users.sorted().prefix(2) // Sort to provide a level of stability
|
||||
|
|
|
@ -115,7 +115,7 @@ class ConversationViewItemActions: NSObject {
|
|||
actions.append(deleteAction)
|
||||
}
|
||||
|
||||
if isGroup && conversationViewItem.interaction.thread.name() == "Session Public Chat" {
|
||||
if isGroup && conversationViewItem.interaction.thread.name() == "Loki Public Chat" {
|
||||
let reportAction = MessageActionBuilder.report(conversationViewItem, delegate: delegate)
|
||||
actions.append(reportAction)
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ class ConversationViewItemActions: NSObject {
|
|||
actions.append(deleteAction)
|
||||
}
|
||||
|
||||
if isGroup && conversationViewItem.interaction.thread.name() == "Session Public Chat" {
|
||||
if isGroup && conversationViewItem.interaction.thread.name() == "Loki Public Chat" {
|
||||
let reportAction = MessageActionBuilder.report(conversationViewItem, delegate: delegate)
|
||||
actions.append(reportAction)
|
||||
}
|
||||
|
@ -192,7 +192,7 @@ class ConversationViewItemActions: NSObject {
|
|||
actions.append(deleteAction)
|
||||
}
|
||||
|
||||
if isGroup && conversationViewItem.interaction.thread.name() == "Session Public Chat" {
|
||||
if isGroup && conversationViewItem.interaction.thread.name() == "Loki Public Chat" {
|
||||
let reportAction = MessageActionBuilder.report(conversationViewItem, delegate: delegate)
|
||||
actions.append(reportAction)
|
||||
}
|
||||
|
|
|
@ -958,7 +958,7 @@ const CGFloat kIconViewLength = 24;
|
|||
|
||||
if (self.isGroupThread) {
|
||||
TSGroupThread* groupThread = (TSGroupThread *)self.thread;
|
||||
if (groupThread.isPublicChat && groupThread.groupModel.groupImage != nil && ![groupThread.groupModel.groupName isEqual:@"Session Public Chat"]) {
|
||||
if (groupThread.isPublicChat && groupThread.groupModel.groupImage != nil && ![groupThread.groupModel.groupName isEqual:@"Loki Public Chat"]) {
|
||||
profilePictureView.openGroupProfilePicture = groupThread.groupModel.groupImage;
|
||||
profilePictureView.isRSSFeed = false;
|
||||
} else {
|
||||
|
|
|
@ -44,6 +44,7 @@ public final class ProfilePictureView : UIView {
|
|||
|
||||
// MARK: Updating
|
||||
@objc public func update() {
|
||||
AssertIsOnMainThread()
|
||||
func getProfilePicture(of size: CGFloat, for hexEncodedPublicKey: String) -> UIImage? {
|
||||
guard !hexEncodedPublicKey.isEmpty else { return nil }
|
||||
return OWSProfileManager.shared().profileAvatar(forRecipientId: hexEncodedPublicKey) ?? Identicon.generateIcon(string: hexEncodedPublicKey, size: size)
|
||||
|
|
Loading…
Reference in New Issue