Show profile picture at top of message stack

pull/68/head
Niels Andriesse 5 years ago
parent 783ab43311
commit 0e9fbb7474

@ -168,7 +168,11 @@
</array> </array>
<key>UIStatusBarStyle</key> <key>UIStatusBarStyle</key>
<string>UIStatusBarStyleLightContent</string> <string>UIStatusBarStyleLightContent</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key> <key>UIViewControllerBasedStatusBarAppearance</key>
<true/> <false/>
</dict> </dict>
</plist> </plist>

@ -233,7 +233,7 @@ NS_ASSUME_NONNULL_BEGIN
// last line of the text (if any, or where it // last line of the text (if any, or where it
// would be). // would be).
[self.messageBubbleView autoPinLeadingToTrailingEdgeOfView:self.avatarView offset:8], [self.messageBubbleView autoPinLeadingToTrailingEdgeOfView:self.avatarView offset:8],
[self.messageBubbleView autoPinEdge:ALEdgeBottom toEdge:ALEdgeBottom ofView:self.avatarView], [self.messageBubbleView autoPinEdge:ALEdgeTop toEdge:ALEdgeTop ofView:self.avatarView],
]]; ]];
[self.viewConstraints addObjectsFromArray:@[ [self.viewConstraints addObjectsFromArray:@[

@ -1503,10 +1503,11 @@ static const int kYapDatabaseRangeMaxLength = 25000;
// the previous message has the same sender name and // the previous message has the same sender name and
// no "date break" separates us. // no "date break" separates us.
BOOL shouldShowSenderName = YES; BOOL shouldShowSenderName = YES;
NSString *_Nullable previousIncomingSenderId = nil;
if (previousViewItem && previousViewItem.interaction.interactionType == interactionType) { if (previousViewItem && previousViewItem.interaction.interactionType == interactionType) {
TSIncomingMessage *previousIncomingMessage = (TSIncomingMessage *)previousViewItem.interaction; TSIncomingMessage *previousIncomingMessage = (TSIncomingMessage *)previousViewItem.interaction;
NSString *previousIncomingSenderId = previousIncomingMessage.authorId; previousIncomingSenderId = previousIncomingMessage.authorId;
OWSAssertDebug(previousIncomingSenderId.length > 0); OWSAssertDebug(previousIncomingSenderId.length > 0);
shouldShowSenderName shouldShowSenderName
@ -1539,9 +1540,8 @@ static const int kYapDatabaseRangeMaxLength = 25000;
// the next message has the same sender avatar and // the next message has the same sender avatar and
// no "date break" separates us. // no "date break" separates us.
shouldShowSenderAvatar = YES; shouldShowSenderAvatar = YES;
if (nextViewItem && nextViewItem.interaction.interactionType == interactionType) { if (previousViewItem && previousViewItem.interaction.interactionType == interactionType) {
shouldShowSenderAvatar = (![NSObject isNullableObject:nextIncomingSenderId equalTo:incomingSenderId] shouldShowSenderAvatar = (![NSObject isNullableObject:previousIncomingSenderId equalTo:incomingSenderId]);
|| nextViewItem.hasCellHeader);
} }
} }
} }

@ -10,7 +10,7 @@ NS_ASSUME_NONNULL_BEGIN
BOOL IsLandscapeOrientationEnabled(void) BOOL IsLandscapeOrientationEnabled(void)
{ {
return YES; return NO;
} }
UIInterfaceOrientationMask DefaultUIInterfaceOrientationMask(void) UIInterfaceOrientationMask DefaultUIInterfaceOrientationMask(void)

@ -2,7 +2,7 @@
// For some reason NSLog doesn't seem to work. This is a workaround to still allow debugging from Obj-C. // For some reason NSLog doesn't seem to work. This is a workaround to still allow debugging from Obj-C.
@objc(LKLogger) @objc(LKLogger)
public final class Objc_Logger : NSObject { public final class ObjC_Logger : NSObject {
private override init() { } private override init() { }

Loading…
Cancel
Save