mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Groups: Name of leaving user + outgoing message layout.
This commit is contained in:
parent
e58f9bf966
commit
a93b111458
|
@ -87,5 +87,4 @@ andCurrentRegionCodeForPhoneNumbers:(NSString*)currentRegionCodeForPhoneNumbers
|
|||
+ (void)messageIdentifier:(NSString*)identifier;
|
||||
+ (void)groupModel:(GroupModel*)model;
|
||||
|
||||
|
||||
@end
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
|
||||
#import "Environment.h"
|
||||
#import "PreferencesUtil.h"
|
||||
#import "ContactsManager.h"
|
||||
|
||||
#import <CocoaLumberjack/DDLog.h>
|
||||
|
||||
|
@ -255,10 +256,17 @@
|
|||
[[[TSInfoMessage alloc] initWithTimestamp:timeStamp inThread:gThread messageType:TSInfoMessageTypeGroupUpdate customMessage:updateGroupInfo] saveWithTransaction:transaction];
|
||||
}
|
||||
else if(content.group.type==PushMessageContentGroupContextTypeQuit) {
|
||||
NSString* updateGroupInfo = [NSString stringWithFormat:@"%@ has left group",message.source];
|
||||
NSString *nameString = [[Environment.getCurrent contactsManager] nameStringForPhoneIdentifier:message.source];
|
||||
|
||||
if (!nameString) {
|
||||
nameString = message.source;
|
||||
}
|
||||
|
||||
NSString* updateGroupInfo = [NSString stringWithFormat:@"%@ has left group",nameString];
|
||||
NSMutableArray *newGroupMembers = [NSMutableArray arrayWithArray:gThread.groupModel.groupMemberIds];
|
||||
[newGroupMembers removeObject:message.source];
|
||||
gThread.groupModel.groupMemberIds = newGroupMembers;
|
||||
|
||||
[gThread saveWithTransaction:transaction];
|
||||
[[[TSInfoMessage alloc] initWithTimestamp:timeStamp inThread:gThread messageType:TSInfoMessageTypeGroupUpdate customMessage:updateGroupInfo] saveWithTransaction:transaction];
|
||||
}
|
||||
|
|
|
@ -110,7 +110,6 @@ typedef enum : NSUInteger {
|
|||
- (void)setupWithThread:(TSThread *)thread{
|
||||
self.thread = thread;
|
||||
isGroupConversation = [self.thread isKindOfClass:[TSGroupThread class]];
|
||||
|
||||
}
|
||||
|
||||
- (void)viewDidLoad {
|
||||
|
@ -1027,7 +1026,6 @@ typedef enum : NSUInteger {
|
|||
|
||||
}
|
||||
|
||||
|
||||
- (IBAction)unwindGroupUpdated:(UIStoryboardSegue *)segue{
|
||||
[self.inputToolbar.contentView.textView resignFirstResponder];
|
||||
NewGroupViewController *ngc = [segue sourceViewController];
|
||||
|
|
|
@ -79,9 +79,11 @@
|
|||
TSIncomingMessage *message = (TSIncomingMessage*)interaction;
|
||||
adapter.senderId = message.authorId;
|
||||
adapter.senderDisplayName = message.authorId;
|
||||
adapter.messageType = TSIncomingMessageAdapter;
|
||||
} else {
|
||||
adapter.senderId = ME_MESSAGE_IDENTIFIER;
|
||||
adapter.senderDisplayName = @"Me";
|
||||
adapter.messageType = TSOutgoingMessageAdapter;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue