Email invitation: Show the name the user is typing in the room member list search input in the first cell of the list

This commit is contained in:
manuroe
2016-02-05 16:42:17 +01:00
parent 4faa6dc6c3
commit bc6984d43b
3 changed files with 27 additions and 4 deletions
@@ -21,6 +21,7 @@
#import "AppDelegate.h"
#import "VectorDesignValues.h"
#import "AvatarGenerator.h"
#import "Contact.h"
@@ -379,7 +380,8 @@
// If the homeserver has converted the 3pid invite into a room member, do no show it
if (![self.mxRoom.state memberWithThirdPartyInviteToken:roomThirdPartyInvite.token])
{
Contact *contact = [[Contact alloc] initMatrixContactWithDisplayName:roomThirdPartyInvite.displayname andMatrixID:nil];
Contact *contact = [[Contact alloc] initMatrixContactWithDisplayName:roomThirdPartyInvite.displayname];
contact.isThirdPartyInvite = YES;
mxkContactsById[roomThirdPartyInvite.token] = contact;
[self addContactToParticipants:contact withKey:roomThirdPartyInvite.token isAdmin:NO];
@@ -998,7 +1000,16 @@
filteredParticipants = [NSMutableArray array];
NSMutableArray *indexArray = [NSMutableArray array];
NSInteger index = 0;
// Show what the user is typing in a cell
// So that he can click on it
if (searchText.length)
{
MXKContact *contact = [[MXKContact alloc] initMatrixContactWithDisplayName:searchText];
[filteredParticipants addObject:contact];
[indexArray addObject:[NSIndexPath indexPathForRow:index++ inSection:0]];
}
for (MXKContact* contact in constacts)
{
if ([contact matchedWithPatterns:@[addParticipantsSearchText]])