mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-22 09:32:52 +02:00
b298dedc22
Merge commit 'f823ab9aae70e8d15ed7cc079210dd9bbbb6c8e1' into feature/foss_update_1_11_19 * commit 'f823ab9aae70e8d15ed7cc079210dd9bbbb6c8e1': finish version++ version++ comments update submodule remove obsolete tests removed unused code update submodule fix Libolm removal update license macro update license Prepare for new sprint # Conflicts: # Config/AppVersion.xcconfig # IDETemplateMacros.plist # LICENSE # README.md # Riot/Categories/MXSession+Riot.m # Riot/Managers/EncryptionKeyManager/EncryptionKeyManager.swift # Riot/Managers/KeyValueStorage/Extensions/Keychain.swift # Riot/Managers/KeyValueStorage/KeyValueStore.swift # Riot/Managers/KeyValueStorage/KeychainStore.swift # Riot/Managers/KeyValueStorage/MemoryStore.swift # Riot/Managers/PushNotification/PushNotificationService.m # Riot/Managers/Settings/RiotSettings.swift # Riot/Managers/Settings/Shared/RiotSharedSettings.swift # Riot/Modules/Analytics/AnalyticsUIElement.swift # Riot/Modules/Application/AppCoordinator.swift # Riot/Modules/Application/LegacyAppDelegate.h # Riot/Modules/Application/LegacyAppDelegate.m # Riot/Modules/Authentication/Legacy/AuthenticationViewController.h # Riot/Modules/Authentication/Legacy/AuthenticationViewController.m # Riot/Modules/Authentication/Legacy/Views/AuthInputsView.h # Riot/Modules/Authentication/Legacy/Views/AuthInputsView.m # Riot/Modules/Common/Recents/DataSources/RecentsDataSource.m # Riot/Modules/Common/Recents/RecentsViewController.m # Riot/Modules/Common/WebViewController/WebViewViewController.m # Riot/Modules/Contacts/Details/ContactDetailsViewController.m # Riot/Modules/Contacts/Views/ContactTableViewCell.m # Riot/Modules/Favorites/FavouritesViewController.h # Riot/Modules/Favorites/FavouritesViewController.m # Riot/Modules/GlobalSearch/UnifiedSearchViewController.m # Riot/Modules/People/PeopleViewController.h # Riot/Modules/People/PeopleViewController.m # Riot/Modules/Room/ContextualMenu/ReactionsMenu/ReactionsMenuViewModel.swift # Riot/Modules/Room/DataSources/RoomDataSource.m # Riot/Modules/Room/Files/RoomFilesViewController.m # Riot/Modules/Room/Members/Detail/RoomMemberDetailsViewController.m # Riot/Modules/Room/Members/RoomParticipantsViewController.m # Riot/Modules/Room/RoomViewController.m # Riot/Modules/Room/Settings/RoomSettingsViewController.m # Riot/Modules/Room/TimelineCells/RoomCreationIntro/RoomCreationIntroCell.swift # Riot/Modules/Room/TimelineCells/RoomCreationIntro/RoomCreationIntroCellContentView.swift # Riot/Modules/Room/TimelineCells/RoomCreationIntro/RoomCreationIntroViewData.swift # Riot/Modules/Room/TimelineCells/RoomTimelineCellIdentifier.h # Riot/Modules/Rooms/RoomsViewController.h # Riot/Modules/Rooms/ShowDirectory/Cells/Network/DirectoryNetworkTableHeaderFooterView.swift # Riot/Modules/Rooms/ShowDirectory/Cells/Room/DirectoryRoomTableViewCell.swift # Riot/Modules/Rooms/ShowDirectory/PublicRoomsDirectoryViewModel.swift # Riot/Modules/Secrets/Recover/RecoverWithKey/SecretsRecoveryWithKeyCoordinator.swift # Riot/Modules/Secrets/Recover/RecoverWithKey/SecretsRecoveryWithKeyViewController.swift # Riot/Modules/Secrets/Recover/RecoverWithPassphrase/SecretsRecoveryWithPassphraseCoordinator.swift # Riot/Modules/Secrets/Recover/RecoverWithPassphrase/SecretsRecoveryWithPassphraseViewController.swift # Riot/Modules/Secrets/Recover/SecretsRecoveryCoordinator.swift # Riot/Modules/SecureBackup/Setup/Intro/SecureBackupSetupIntroViewController.swift # Riot/Modules/SecureBackup/Setup/Intro/SecureBackupSetupIntroViewModel.swift # Riot/Modules/SecureBackup/Setup/Intro/SecureBackupSetupIntroViewModelType.swift # Riot/Modules/SetPinCode/PinCodePreferences.swift # Riot/Modules/SetPinCode/SetupBiometrics/BiometricsAuthenticationPresenter.swift # Riot/Modules/Settings/Security/ManageSession/ManageSessionViewController.m # Riot/Modules/Settings/Security/SecurityViewController.m # Riot/Modules/Settings/SettingsViewController.m # Riot/Modules/SplitView/SplitViewCoordinator.swift # Riot/Modules/SplitView/SplitViewCoordinatorType.swift # Riot/Modules/StartChat/StartChatViewController.m # Riot/Modules/TabBar/MasterTabBarController.h # Riot/Modules/TabBar/MasterTabBarController.m # Riot/Utils/EventFormatter.m # Riot/Utils/HTMLFormatter.swift # Riot/Utils/Tools.m # RiotNSE/NotificationService.swift
181 lines
4.7 KiB
Objective-C
181 lines
4.7 KiB
Objective-C
/*
|
|
Copyright 2024 New Vector Ltd.
|
|
Copyright 2017 Vector Creations Ltd
|
|
Copyright 2015 OpenMarket Ltd
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
Please see LICENSE in the repository root for full details.
|
|
*/
|
|
|
|
#import <UIKit/UIKit.h>
|
|
|
|
#import <AddressBook/AddressBook.h>
|
|
|
|
#import "MXKCellData.h"
|
|
|
|
#import "MXKEmail.h"
|
|
#import "MXKPhoneNumber.h"
|
|
|
|
/**
|
|
Posted when the contact thumbnail is updated.
|
|
The notification object is a contact Id.
|
|
*/
|
|
extern NSString *const kMXKContactThumbnailUpdateNotification;
|
|
|
|
extern NSString *const kMXKContactLocalContactPrefixId;
|
|
extern NSString *const kMXKContactMatrixContactPrefixId;
|
|
extern NSString *const kMXKContactDefaultContactPrefixId;
|
|
|
|
@interface MXKContact : MXKCellData <NSCoding>
|
|
|
|
/**
|
|
The unique identifier
|
|
*/
|
|
@property (nonatomic, readonly) NSString * contactID;
|
|
|
|
/**
|
|
The display name
|
|
*/
|
|
@property (nonatomic, readwrite) NSString *displayName;
|
|
|
|
/**
|
|
The sorting display name built by trimming the symbols [_!~`@#$%^&*-+();:={}[],.<>?\/"'] from the display name.
|
|
*/
|
|
@property (nonatomic) NSString* sortingDisplayName;
|
|
|
|
/**
|
|
The contact thumbnail. Default size: 256 X 256 pixels
|
|
*/
|
|
@property (nonatomic, copy, readonly) UIImage *thumbnail;
|
|
|
|
/**
|
|
YES if the contact does not exist in the contacts book
|
|
the contact has been created from a MXUser or MXRoomThirdPartyInvite
|
|
*/
|
|
@property (nonatomic) BOOL isMatrixContact;
|
|
|
|
/**
|
|
YES if the contact is coming from MXRoomThirdPartyInvite event (NO by default).
|
|
*/
|
|
@property (nonatomic) BOOL isThirdPartyInvite;
|
|
|
|
/**
|
|
The array of MXKPhoneNumber
|
|
*/
|
|
@property (nonatomic, readonly) NSArray *phoneNumbers;
|
|
|
|
/**
|
|
The array of MXKEmail
|
|
*/
|
|
@property (nonatomic, readonly) NSArray *emailAddresses;
|
|
|
|
/**
|
|
The array of matrix identifiers
|
|
*/
|
|
@property (nonatomic, readonly) NSArray* matrixIdentifiers;
|
|
|
|
/**
|
|
The matrix avatar url used (if any) to build the current thumbnail, nil by default.
|
|
*/
|
|
@property (nonatomic, readonly) NSString* matrixAvatarURL;
|
|
|
|
/**
|
|
bwi Nicknames
|
|
*/
|
|
@property (nonatomic) NSString* bwiUserLabel;
|
|
|
|
/**
|
|
BWI: 5208 Federation
|
|
*/
|
|
@property (nonatomic) BOOL bwiIsFederated;
|
|
|
|
/**
|
|
Reset the current thumbnail if it is retrieved from a matrix url. May be used in case of the matrix avatar url change.
|
|
A new thumbnail will be automatically restored from the contact data.
|
|
*/
|
|
- (void)resetMatrixThumbnail;
|
|
|
|
#pragma clang diagnostic push
|
|
#pragma clang diagnostic ignored "-Wdeprecated"
|
|
/**
|
|
The contact ID from native phonebook record
|
|
*/
|
|
+ (NSString*)contactID:(ABRecordRef)record;
|
|
|
|
/**
|
|
Create a local contact from a device contact
|
|
|
|
@param record device contact id
|
|
@return MXKContact instance
|
|
*/
|
|
- (id)initLocalContactWithABRecord:(ABRecordRef)record;
|
|
#pragma clang diagnostic pop
|
|
|
|
/**
|
|
Create a matrix contact with the dedicated info
|
|
|
|
@param displayName the contact display name
|
|
@param matrixID the contact matrix id
|
|
@return MXKContact instance
|
|
*/
|
|
- (id)initMatrixContactWithDisplayName:(NSString*)displayName andMatrixID:(NSString*)matrixID;
|
|
|
|
/**
|
|
Create a matrix contact with the dedicated info
|
|
|
|
@param displayName the contact display name
|
|
@param matrixID the contact matrix id
|
|
@param matrixAvatarURL the matrix avatar url
|
|
@return MXKContact instance
|
|
*/
|
|
- (id)initMatrixContactWithDisplayName:(NSString*)displayName matrixID:(NSString*)matrixID andMatrixAvatarURL:(NSString*)matrixAvatarURL;
|
|
|
|
/**
|
|
Create a contact with the dedicated info
|
|
|
|
@param displayName the contact display name
|
|
@param emails an array of emails
|
|
@param phones an array of phone numbers
|
|
@param thumbnail the contact thumbnail
|
|
@return MXKContact instance
|
|
*/
|
|
- (id)initContactWithDisplayName:(NSString*)displayName
|
|
emails:(NSArray<MXKEmail*> *)emails
|
|
phoneNumbers:(NSArray<MXKPhoneNumber*> *)phones
|
|
andThumbnail:(UIImage *)thumbnail;
|
|
|
|
/**
|
|
The contact thumbnail with a prefered size.
|
|
|
|
If the thumbnail is already loaded, this method returns this one by ignoring prefered size.
|
|
The prefered size is used only if a server request is required.
|
|
|
|
@return thumbnail with a prefered size
|
|
*/
|
|
- (UIImage*)thumbnailWithPreferedSize:(CGSize)size;
|
|
|
|
/**
|
|
Tell whether a component of the contact's displayName, or one of his matrix id/email has the provided prefix.
|
|
|
|
@param prefix a non empty string.
|
|
@return YES when at least one matrix id, email or a component of the display name has this prefix.
|
|
*/
|
|
- (BOOL)hasPrefix:(NSString*)prefix;
|
|
|
|
/**
|
|
Check if the patterns can match with this contact
|
|
*/
|
|
- (BOOL)matchedWithPatterns:(NSArray*)patterns;
|
|
|
|
/**
|
|
The default ISO 3166-1 country code used to internationalize the contact phone numbers.
|
|
*/
|
|
@property (nonatomic) NSString *defaultCountryCode;
|
|
|
|
/**
|
|
BWI: 5208 Check if the contact comes from a federated server
|
|
*/
|
|
- (void)checkFederation:(NSString *)homeServerId;
|
|
|
|
@end
|