mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-29 15:52:40 +00:00
Bug Fix - Show riot enabled local contacts in known contacts too.
#1001
This commit is contained in:
parent
6bcb88252c
commit
cc5fbfaa1c
2 changed files with 3 additions and 45 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright 2017 OpenMarket Ltd
|
Copyright 2017 Vector Creations Ltd
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright 2017 OpenMarket Ltd
|
Copyright 2017 Vector Creations Ltd
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
@ -45,9 +45,6 @@
|
||||||
// This dictionary tells for each display name whether it appears several times.
|
// This dictionary tells for each display name whether it appears several times.
|
||||||
NSMutableDictionary <NSString*,NSNumber*> *isMultiUseNameByDisplayName;
|
NSMutableDictionary <NSString*,NSNumber*> *isMultiUseNameByDisplayName;
|
||||||
|
|
||||||
// Report all the contacts by matrix id.
|
|
||||||
NSMutableDictionary <NSString*, MXKContact*> *contactsByMatrixId;
|
|
||||||
|
|
||||||
// Shrinked sections.
|
// Shrinked sections.
|
||||||
BOOL enableSectionShrinking;
|
BOOL enableSectionShrinking;
|
||||||
NSInteger shrinkedSectionsBitMask;
|
NSInteger shrinkedSectionsBitMask;
|
||||||
|
@ -96,7 +93,6 @@
|
||||||
_ignoredContactsByMatrixId = [NSMutableDictionary dictionary];
|
_ignoredContactsByMatrixId = [NSMutableDictionary dictionary];
|
||||||
|
|
||||||
isMultiUseNameByDisplayName = [NSMutableDictionary dictionary];
|
isMultiUseNameByDisplayName = [NSMutableDictionary dictionary];
|
||||||
contactsByMatrixId = [NSMutableDictionary dictionary];
|
|
||||||
|
|
||||||
_forceMatrixIdInDisplayName = NO;
|
_forceMatrixIdInDisplayName = NO;
|
||||||
|
|
||||||
|
@ -143,7 +139,6 @@
|
||||||
searchProcessingMatrixContacts = nil;
|
searchProcessingMatrixContacts = nil;
|
||||||
|
|
||||||
isMultiUseNameByDisplayName = nil;
|
isMultiUseNameByDisplayName = nil;
|
||||||
contactsByMatrixId = nil;
|
|
||||||
|
|
||||||
_contactCellAccessoryImage = nil;
|
_contactCellAccessoryImage = nil;
|
||||||
|
|
||||||
|
@ -264,10 +259,6 @@
|
||||||
shrinkedSectionsBitMask = 0;
|
shrinkedSectionsBitMask = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// List all the filtered local Matrix-enabled contacts by their matrix id to remove a contact
|
|
||||||
// from the "Known Contacts" section if a local contact matches with his Matrix identifier.
|
|
||||||
[contactsByMatrixId removeAllObjects];
|
|
||||||
|
|
||||||
for (NSUInteger index = 0; index < searchProcessingLocalContacts.count;)
|
for (NSUInteger index = 0; index < searchProcessingLocalContacts.count;)
|
||||||
{
|
{
|
||||||
MXKContact* contact = searchProcessingLocalContacts[index];
|
MXKContact* contact = searchProcessingLocalContacts[index];
|
||||||
|
@ -278,13 +269,6 @@
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NSArray *identifiers = contact.matrixIdentifiers;
|
|
||||||
if (identifiers.count)
|
|
||||||
{
|
|
||||||
// Here the contact can only have one identifier
|
|
||||||
contactsByMatrixId[identifiers.firstObject] = contact;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Next
|
// Next
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
@ -328,33 +312,7 @@
|
||||||
// Update the filtered contacts.
|
// Update the filtered contacts.
|
||||||
currentSearchText = searchProcessingText;
|
currentSearchText = searchProcessingText;
|
||||||
filteredLocalContacts = searchProcessingLocalContacts;
|
filteredLocalContacts = searchProcessingLocalContacts;
|
||||||
|
|
||||||
// Check whether some Matrix-enabled contacts are listed in the local contact.
|
|
||||||
if (contactsByMatrixId.count)
|
|
||||||
{
|
|
||||||
// Remove a contact from the "Known Contacts" section if a local contact matches with his Matrix identifier.
|
|
||||||
filteredMatrixContacts = [NSMutableArray arrayWithArray:searchProcessingMatrixContacts];
|
|
||||||
for (NSUInteger index = 0; index < filteredMatrixContacts.count;)
|
|
||||||
{
|
|
||||||
MXKContact* contact = filteredMatrixContacts[index];
|
|
||||||
|
|
||||||
// Here the contact can only have one identifier
|
|
||||||
NSArray *identifiers = contact.matrixIdentifiers;
|
|
||||||
if (identifiers.count && contactsByMatrixId[identifiers.firstObject])
|
|
||||||
{
|
|
||||||
[filteredMatrixContacts removeObjectAtIndex:index];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Next
|
|
||||||
index++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
filteredMatrixContacts = searchProcessingMatrixContacts;
|
filteredMatrixContacts = searchProcessingMatrixContacts;
|
||||||
}
|
|
||||||
|
|
||||||
if (!self.forceMatrixIdInDisplayName)
|
if (!self.forceMatrixIdInDisplayName)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue