mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-30 16:22:39 +00:00
Replace Console prefix with MXC
This commit is contained in:
parent
5c3baf0180
commit
4ce33b1500
14 changed files with 95 additions and 95 deletions
|
@ -9,13 +9,13 @@
|
|||
/* Begin PBXBuildFile section */
|
||||
710210A41A67A4B600364868 /* MXCGrowingTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 710210A31A67A4B600364868 /* MXCGrowingTextView.m */; };
|
||||
710CC3BF1A6E9F14006EE973 /* matrixUser.png in Resources */ = {isa = PBXBuildFile; fileRef = 710CC3BE1A6E9F14006EE973 /* matrixUser.png */; };
|
||||
710CC3C21A70F28F006EE973 /* ConsoleContactField.m in Sources */ = {isa = PBXBuildFile; fileRef = 710CC3C11A70F28F006EE973 /* ConsoleContactField.m */; };
|
||||
710CC3C21A70F28F006EE973 /* MXCContactField.m in Sources */ = {isa = PBXBuildFile; fileRef = 710CC3C11A70F28F006EE973 /* MXCContactField.m */; };
|
||||
71193D241A6D64F900E59A9E /* AddressBook.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 71193D231A6D64F900E59A9E /* AddressBook.framework */; };
|
||||
71193D291A6E3DC000E59A9E /* ContactsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71193D281A6E3DC000E59A9E /* ContactsViewController.m */; };
|
||||
71193D2C1A6E433900E59A9E /* ContactTableCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 71193D2B1A6E433900E59A9E /* ContactTableCell.m */; };
|
||||
71193D361A6E49F000E59A9E /* ConsoleContact.m in Sources */ = {isa = PBXBuildFile; fileRef = 71193D311A6E49F000E59A9E /* ConsoleContact.m */; };
|
||||
71193D371A6E49F000E59A9E /* ConsoleEmail.m in Sources */ = {isa = PBXBuildFile; fileRef = 71193D331A6E49F000E59A9E /* ConsoleEmail.m */; };
|
||||
71193D381A6E49F000E59A9E /* ConsolePhoneNumber.m in Sources */ = {isa = PBXBuildFile; fileRef = 71193D351A6E49F000E59A9E /* ConsolePhoneNumber.m */; };
|
||||
71193D361A6E49F000E59A9E /* MXCContact.m in Sources */ = {isa = PBXBuildFile; fileRef = 71193D311A6E49F000E59A9E /* MXCContact.m */; };
|
||||
71193D371A6E49F000E59A9E /* MXCEmail.m in Sources */ = {isa = PBXBuildFile; fileRef = 71193D331A6E49F000E59A9E /* MXCEmail.m */; };
|
||||
71193D381A6E49F000E59A9E /* MXCPhoneNumber.m in Sources */ = {isa = PBXBuildFile; fileRef = 71193D351A6E49F000E59A9E /* MXCPhoneNumber.m */; };
|
||||
71193D3B1A6E50EC00E59A9E /* ContactManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 71193D3A1A6E50EC00E59A9E /* ContactManager.m */; };
|
||||
71193D3E1A6E61AD00E59A9E /* SectionedContacts.m in Sources */ = {isa = PBXBuildFile; fileRef = 71193D3D1A6E61AD00E59A9E /* SectionedContacts.m */; };
|
||||
71D2E4EC1A49814B000DE015 /* RoomMemberActionsCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 71D2E4EB1A49814B000DE015 /* RoomMemberActionsCell.m */; };
|
||||
|
@ -83,19 +83,19 @@
|
|||
710210A21A67A4B600364868 /* MXCGrowingTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MXCGrowingTextView.h; sourceTree = "<group>"; };
|
||||
710210A31A67A4B600364868 /* MXCGrowingTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MXCGrowingTextView.m; sourceTree = "<group>"; };
|
||||
710CC3BE1A6E9F14006EE973 /* matrixUser.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = matrixUser.png; sourceTree = "<group>"; };
|
||||
710CC3C01A70F28F006EE973 /* ConsoleContactField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConsoleContactField.h; sourceTree = "<group>"; };
|
||||
710CC3C11A70F28F006EE973 /* ConsoleContactField.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ConsoleContactField.m; sourceTree = "<group>"; };
|
||||
710CC3C01A70F28F006EE973 /* MXCContactField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MXCContactField.h; sourceTree = "<group>"; };
|
||||
710CC3C11A70F28F006EE973 /* MXCContactField.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MXCContactField.m; sourceTree = "<group>"; };
|
||||
71193D231A6D64F900E59A9E /* AddressBook.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AddressBook.framework; path = System/Library/Frameworks/AddressBook.framework; sourceTree = SDKROOT; };
|
||||
71193D271A6E3DC000E59A9E /* ContactsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContactsViewController.h; sourceTree = "<group>"; };
|
||||
71193D281A6E3DC000E59A9E /* ContactsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContactsViewController.m; sourceTree = "<group>"; };
|
||||
71193D2A1A6E433900E59A9E /* ContactTableCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContactTableCell.h; sourceTree = "<group>"; };
|
||||
71193D2B1A6E433900E59A9E /* ContactTableCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContactTableCell.m; sourceTree = "<group>"; };
|
||||
71193D301A6E49F000E59A9E /* ConsoleContact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConsoleContact.h; sourceTree = "<group>"; };
|
||||
71193D311A6E49F000E59A9E /* ConsoleContact.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ConsoleContact.m; sourceTree = "<group>"; };
|
||||
71193D321A6E49F000E59A9E /* ConsoleEmail.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConsoleEmail.h; sourceTree = "<group>"; };
|
||||
71193D331A6E49F000E59A9E /* ConsoleEmail.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ConsoleEmail.m; sourceTree = "<group>"; };
|
||||
71193D341A6E49F000E59A9E /* ConsolePhoneNumber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConsolePhoneNumber.h; sourceTree = "<group>"; };
|
||||
71193D351A6E49F000E59A9E /* ConsolePhoneNumber.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ConsolePhoneNumber.m; sourceTree = "<group>"; };
|
||||
71193D301A6E49F000E59A9E /* MXCContact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MXCContact.h; sourceTree = "<group>"; };
|
||||
71193D311A6E49F000E59A9E /* MXCContact.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MXCContact.m; sourceTree = "<group>"; };
|
||||
71193D321A6E49F000E59A9E /* MXCEmail.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MXCEmail.h; sourceTree = "<group>"; };
|
||||
71193D331A6E49F000E59A9E /* MXCEmail.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MXCEmail.m; sourceTree = "<group>"; };
|
||||
71193D341A6E49F000E59A9E /* MXCPhoneNumber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MXCPhoneNumber.h; sourceTree = "<group>"; };
|
||||
71193D351A6E49F000E59A9E /* MXCPhoneNumber.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MXCPhoneNumber.m; sourceTree = "<group>"; };
|
||||
71193D391A6E50EC00E59A9E /* ContactManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContactManager.h; sourceTree = "<group>"; };
|
||||
71193D3A1A6E50EC00E59A9E /* ContactManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContactManager.m; sourceTree = "<group>"; };
|
||||
71193D3C1A6E61AD00E59A9E /* SectionedContacts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SectionedContacts.h; sourceTree = "<group>"; };
|
||||
|
@ -309,16 +309,16 @@
|
|||
F0465AF71A251F85003639F9 /* Model */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
71193D301A6E49F000E59A9E /* ConsoleContact.h */,
|
||||
71193D311A6E49F000E59A9E /* ConsoleContact.m */,
|
||||
710CC3C01A70F28F006EE973 /* ConsoleContactField.h */,
|
||||
710CC3C11A70F28F006EE973 /* ConsoleContactField.m */,
|
||||
71193D321A6E49F000E59A9E /* ConsoleEmail.h */,
|
||||
71193D331A6E49F000E59A9E /* ConsoleEmail.m */,
|
||||
71193D301A6E49F000E59A9E /* MXCContact.h */,
|
||||
71193D311A6E49F000E59A9E /* MXCContact.m */,
|
||||
710CC3C01A70F28F006EE973 /* MXCContactField.h */,
|
||||
710CC3C11A70F28F006EE973 /* MXCContactField.m */,
|
||||
71193D321A6E49F000E59A9E /* MXCEmail.h */,
|
||||
71193D331A6E49F000E59A9E /* MXCEmail.m */,
|
||||
710210A21A67A4B600364868 /* MXCGrowingTextView.h */,
|
||||
710210A31A67A4B600364868 /* MXCGrowingTextView.m */,
|
||||
71193D341A6E49F000E59A9E /* ConsolePhoneNumber.h */,
|
||||
71193D351A6E49F000E59A9E /* ConsolePhoneNumber.m */,
|
||||
71193D341A6E49F000E59A9E /* MXCPhoneNumber.h */,
|
||||
71193D351A6E49F000E59A9E /* MXCPhoneNumber.m */,
|
||||
F0D942F41A31F3A300826CC1 /* RecentRoom.h */,
|
||||
F0D942F51A31F3A300826CC1 /* RecentRoom.m */,
|
||||
F0465AF81A251F85003639F9 /* RoomMessage.h */,
|
||||
|
@ -559,14 +559,14 @@
|
|||
F07A80DB19DD9DE700B621A1 /* AppDelegate.m in Sources */,
|
||||
F03EF5FF19F1762000A0EE52 /* RoomMessageTableCell.m in Sources */,
|
||||
F07A80D819DD9DE700B621A1 /* main.m in Sources */,
|
||||
71193D371A6E49F000E59A9E /* ConsoleEmail.m in Sources */,
|
||||
71193D371A6E49F000E59A9E /* MXCEmail.m in Sources */,
|
||||
F05B955F19DEED8A008761B0 /* MatrixHandler.m in Sources */,
|
||||
71193D3E1A6E61AD00E59A9E /* SectionedContacts.m in Sources */,
|
||||
F021FBEF1A5EF57300EA3AE6 /* MediaLoader.m in Sources */,
|
||||
F03EF5FB19F171EB00A0EE52 /* SettingsViewController.m in Sources */,
|
||||
F02900BB1A63C71E00356F7D /* MXCTools.m in Sources */,
|
||||
71193D361A6E49F000E59A9E /* ConsoleContact.m in Sources */,
|
||||
710CC3C21A70F28F006EE973 /* ConsoleContactField.m in Sources */,
|
||||
71193D361A6E49F000E59A9E /* MXCContact.m in Sources */,
|
||||
710CC3C21A70F28F006EE973 /* MXCContactField.m in Sources */,
|
||||
F01A0FF31A27314B009FAE2F /* RoomMessageComponent.m in Sources */,
|
||||
F03EF5FA19F171EB00A0EE52 /* RoomViewController.m in Sources */,
|
||||
F03EF5F819F171EB00A0EE52 /* MasterTabBarController.m in Sources */,
|
||||
|
@ -582,7 +582,7 @@
|
|||
71193D291A6E3DC000E59A9E /* ContactsViewController.m in Sources */,
|
||||
F03C47111A02952800E445AB /* MXCAlert.m in Sources */,
|
||||
F0E84D401A1F9AEC005F2E42 /* RecentsTableViewCell.m in Sources */,
|
||||
71193D381A6E49F000E59A9E /* ConsolePhoneNumber.m in Sources */,
|
||||
71193D381A6E49F000E59A9E /* MXCPhoneNumber.m in Sources */,
|
||||
71193D3B1A6E50EC00E59A9E /* ContactManager.m in Sources */,
|
||||
71193D2C1A6E433900E59A9E /* ContactTableCell.m in Sources */,
|
||||
F02D707619F1DC9E007B47D3 /* RoomMemberTableCell.m in Sources */,
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
|
||||
#import "ContactManager.h"
|
||||
|
||||
#import "ConsoleContact.h"
|
||||
#import "ConsolePhoneNumber.h"
|
||||
#import "ConsoleEmail.h"
|
||||
#import "MXCContact.h"
|
||||
#import "MXCPhoneNumber.h"
|
||||
#import "MXCEmail.h"
|
||||
|
||||
#import "MatrixHandler.h"
|
||||
|
||||
|
@ -103,7 +103,7 @@ static ContactManager* sharedContactManager = nil;
|
|||
|
||||
for (index = 0; index < peopleCount; index++) {
|
||||
contactRecord = (ABRecordRef)CFArrayGetValueAtIndex(people, index);
|
||||
[contactsList addObject:[[ConsoleContact alloc] initWithABRecord:contactRecord]];
|
||||
[contactsList addObject:[[MXCContact alloc] initWithABRecord:contactRecord]];
|
||||
}
|
||||
|
||||
CFRelease(people);
|
||||
|
@ -128,7 +128,7 @@ static ContactManager* sharedContactManager = nil;
|
|||
NSMutableArray* pids = [[NSMutableArray alloc] init];
|
||||
NSMutableArray* medias = [[NSMutableArray alloc] init];
|
||||
|
||||
for(ConsoleContact* contact in contacts) {
|
||||
for(MXCContact* contact in contacts) {
|
||||
// the phonenumbers are not managed
|
||||
/*for(ConsolePhoneNumber* pn in contact.phoneNumbers) {
|
||||
if (pn.textNumber.length > 0) {
|
||||
|
@ -141,7 +141,7 @@ static ContactManager* sharedContactManager = nil;
|
|||
}
|
||||
}*/
|
||||
|
||||
for(ConsoleEmail* email in contact.emailAddresses) {
|
||||
for(MXCEmail* email in contact.emailAddresses) {
|
||||
if (email.emailAddress.length > 0) {
|
||||
|
||||
// not yet added
|
||||
|
@ -166,7 +166,7 @@ static ContactManager* sharedContactManager = nil;
|
|||
|
||||
matrixIDBy3PID = [[NSMutableDictionary alloc] initWithObjects:userIds forKeys:pids];
|
||||
|
||||
for(ConsoleContact* contact in contacts) {
|
||||
for(MXCContact* contact in contacts) {
|
||||
// the phonenumbers wil be managed later
|
||||
/*for(ConsolePhoneNumber* pn in contact.phoneNumbers) {
|
||||
if (pn.textNumber.length > 0) {
|
||||
|
@ -179,7 +179,7 @@ static ContactManager* sharedContactManager = nil;
|
|||
}
|
||||
}*/
|
||||
|
||||
for(ConsoleEmail* email in contact.emailAddresses) {
|
||||
for(MXCEmail* email in contact.emailAddresses) {
|
||||
if (email.emailAddress.length > 0) {
|
||||
id matrixID = [matrixIDBy3PID valueForKey:email.emailAddress];
|
||||
|
||||
|
@ -206,8 +206,8 @@ static ContactManager* sharedContactManager = nil;
|
|||
NSString* dummyContactID = [NSString stringWithFormat:@"%lu", (unsigned long)user.userId.hash];
|
||||
|
||||
// with the current API, there is no way to get the email from the matrxID
|
||||
ConsoleEmail* email = [[ConsoleEmail alloc] initWithEmailAddress:user.userId type:@"" contactID:dummyContactID matrixID:user.userId];
|
||||
ConsoleContact* contact = [[ConsoleContact alloc] initWithDisplayName:(user.displayname ? user.displayname : user.userId) contactID:dummyContactID emails:@[email] phonenumbers:nil];
|
||||
MXCEmail* email = [[MXCEmail alloc] initWithEmailAddress:user.userId type:@"" contactID:dummyContactID matrixID:user.userId];
|
||||
MXCContact* contact = [[MXCContact alloc] initWithDisplayName:(user.displayname ? user.displayname : user.userId) contactID:dummyContactID emails:@[email] phonenumbers:nil];
|
||||
|
||||
[unknownRoomContacts addObject:contact];
|
||||
}
|
||||
|
@ -251,7 +251,7 @@ static ContactManager* sharedContactManager = nil;
|
|||
|
||||
int contactsCount = 0;
|
||||
|
||||
for (ConsoleContact *aContact in contactsList)
|
||||
for (MXCContact *aContact in contactsList)
|
||||
{
|
||||
NSInteger section = [collation sectionForObject:aContact collationStringSelector:@selector(displayName)] + indexOffset;
|
||||
|
||||
|
|
|
@ -1371,7 +1371,7 @@
|
|||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Qu4-km-MZA" id="uEH-gd-MNN">
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="B4B-GZ-atv" customClass="CustomImageView">
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="B4B-GZ-atv" customClass="MXCImageView">
|
||||
<rect key="frame" x="12" y="5" width="40" height="40"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
<color key="tintColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
|
|
|
@ -19,12 +19,12 @@
|
|||
|
||||
// warn when a contact has a new matrix identifier
|
||||
// the contactID is provided in parameter
|
||||
extern NSString *const kConsoleContactMatrixIdentifierUpdateNotification;
|
||||
extern NSString *const kMXCContactMatrixIdentifierUpdateNotification;
|
||||
// warn when the contact thumbnail is updated
|
||||
// the contactID is provided in parameter
|
||||
extern NSString *const kConsoleContactThumbnailUpdateNotification;
|
||||
extern NSString *const kMXCContactThumbnailUpdateNotification;
|
||||
|
||||
@interface ConsoleContact : NSObject
|
||||
@interface MXCContact : NSObject
|
||||
|
||||
// unique identifier
|
||||
@property (nonatomic, readonly) NSString * contactID;
|
||||
|
@ -32,9 +32,9 @@ extern NSString *const kConsoleContactThumbnailUpdateNotification;
|
|||
@property (nonatomic, readonly) NSString *displayName;
|
||||
// contact thumbnail
|
||||
@property (nonatomic, copy, readonly) UIImage *thumbnail;
|
||||
// array of ConsolePhoneNumber
|
||||
// array of MXCPhoneNumber
|
||||
@property (nonatomic, readonly) NSArray *phoneNumbers;
|
||||
// array of ConsoleEmail
|
||||
// array of MXCEmail
|
||||
@property (nonatomic, readonly) NSArray *emailAddresses;
|
||||
// array of matrix identifiers
|
||||
@property (nonatomic, readonly) NSArray* matrixIdentifiers;
|
|
@ -14,26 +14,26 @@
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
#import "ConsoleContact.h"
|
||||
#import "MXCContact.h"
|
||||
|
||||
#import "ConsoleEmail.h"
|
||||
#import "ConsolePhoneNumber.h"
|
||||
#import "MXCEmail.h"
|
||||
#import "MXCPhoneNumber.h"
|
||||
|
||||
// warn when a contact has a new matrix identifier
|
||||
// the contactID is provided in parameter
|
||||
NSString *const kConsoleContactMatrixIdentifierUpdateNotification = @"kConsoleContactMatrixIdentifierUpdateNotification";
|
||||
NSString *const kMXCContactMatrixIdentifierUpdateNotification = @"kMXCContactMatrixIdentifierUpdateNotification";
|
||||
|
||||
// warn when the contact thumbnail is updated
|
||||
// the contactID is provided in parameter
|
||||
NSString *const kConsoleContactThumbnailUpdateNotification = @"kConsoleContactThumbnailUpdateNotification";
|
||||
NSString *const kMXCContactThumbnailUpdateNotification = @"kMXCContactThumbnailUpdateNotification";
|
||||
|
||||
@interface ConsoleContact() {
|
||||
@interface MXCContact() {
|
||||
UIImage* contactBookThumbnail;
|
||||
UIImage* matrixThumbnail;
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation ConsoleContact
|
||||
@implementation MXCContact
|
||||
|
||||
- (id) initWithABRecord:(ABRecordRef)record {
|
||||
self = [super init];
|
||||
|
@ -80,7 +80,7 @@ NSString *const kConsoleContactThumbnailUpdateNotification = @"kConsoleContactTh
|
|||
}
|
||||
}
|
||||
|
||||
[pns addObject:[[ConsolePhoneNumber alloc] initWithTextNumber:phoneVal type:lbl contactID:_contactID matrixID:nil]];
|
||||
[pns addObject:[[MXCPhoneNumber alloc] initWithTextNumber:phoneVal type:lbl contactID:_contactID matrixID:nil]];
|
||||
|
||||
if (lblRef) {
|
||||
CFRelease(lblRef);
|
||||
|
@ -131,7 +131,7 @@ NSString *const kConsoleContactThumbnailUpdateNotification = @"kConsoleContactTh
|
|||
}
|
||||
}
|
||||
|
||||
[emails addObject: [[ConsoleEmail alloc] initWithEmailAddress:emailVal type:lbl contactID:_contactID matrixID:nil]];
|
||||
[emails addObject: [[MXCEmail alloc] initWithEmailAddress:emailVal type:lbl contactID:_contactID matrixID:nil]];
|
||||
|
||||
if (lblRef) {
|
||||
CFRelease(lblRef);
|
||||
|
@ -194,13 +194,13 @@ NSString *const kConsoleContactThumbnailUpdateNotification = @"kConsoleContactTh
|
|||
- (NSArray*) matrixIdentifiers {
|
||||
NSMutableArray* identifiers = [[NSMutableArray alloc] init];
|
||||
|
||||
for(ConsoleEmail* email in _emailAddresses) {
|
||||
for(MXCEmail* email in _emailAddresses) {
|
||||
if (email.matrixID && ([identifiers indexOfObject:email.matrixID] == NSNotFound)) {
|
||||
[identifiers addObject:email.matrixID];
|
||||
}
|
||||
}
|
||||
|
||||
for(ConsolePhoneNumber* pn in _phoneNumbers) {
|
||||
for(MXCPhoneNumber* pn in _phoneNumbers) {
|
||||
if (pn.matrixID && ([identifiers indexOfObject:pn.matrixID] == NSNotFound)) {
|
||||
[identifiers addObject:pn.matrixID];
|
||||
}
|
||||
|
@ -222,11 +222,11 @@ NSString *const kConsoleContactThumbnailUpdateNotification = @"kConsoleContactTh
|
|||
// try to replace the thumbnail by the matrix one
|
||||
if (_emailAddresses.count > 0) {
|
||||
//
|
||||
ConsoleEmail* firstEmail = nil;
|
||||
MXCEmail* firstEmail = nil;
|
||||
|
||||
// list the linked email
|
||||
// search if one email field has a dedicated thumbnail
|
||||
for(ConsoleEmail* email in _emailAddresses) {
|
||||
for(MXCEmail* email in _emailAddresses) {
|
||||
if (email.avatarImage) {
|
||||
matrixThumbnail = email.avatarImage;
|
||||
return matrixThumbnail;
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface ConsoleContactField : NSObject
|
||||
@interface MXCContactField : NSObject
|
||||
|
||||
// contact ID where the email has been found
|
||||
@property (nonatomic, readonly) NSString *contactID;
|
|
@ -14,10 +14,10 @@
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
#import "ConsoleContactField.h"
|
||||
#import "MXCContactField.h"
|
||||
|
||||
// wanr when there is a contact update
|
||||
#import "ConsoleContact.h"
|
||||
#import "MXCContact.h"
|
||||
|
||||
// image URL
|
||||
#import "MatrixHandler.h"
|
||||
|
@ -26,12 +26,12 @@
|
|||
#import "MediaManager.h"
|
||||
|
||||
|
||||
@interface ConsoleContactField() {
|
||||
@interface MXCContactField() {
|
||||
NSString* avatarURL;
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation ConsoleContactField
|
||||
@implementation MXCContactField
|
||||
|
||||
- (void) fieldInit {
|
||||
// init members
|
||||
|
@ -63,7 +63,7 @@
|
|||
_matrixID = aMatrixID;
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:kConsoleContactMatrixIdentifierUpdateNotification object:_contactID userInfo:nil];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:kMXCContactMatrixIdentifierUpdateNotification object:_contactID userInfo:nil];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -127,7 +127,7 @@
|
|||
// the image is already in the cache
|
||||
if (_avatarImage) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:kConsoleContactThumbnailUpdateNotification object:_contactID userInfo:nil];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:kMXCContactThumbnailUpdateNotification object:_contactID userInfo:nil];
|
||||
});
|
||||
} else {
|
||||
MediaLoader* loader = [MediaManager existingDownloaderForURL:avatarURL inFolder:kMediaManagerThumbnailFolder];
|
||||
|
@ -153,7 +153,7 @@
|
|||
_avatarImage = image;
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:kConsoleContactThumbnailUpdateNotification object:_contactID userInfo:nil];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:kMXCContactThumbnailUpdateNotification object:_contactID userInfo:nil];
|
||||
});
|
||||
}
|
||||
}
|
|
@ -15,9 +15,9 @@
|
|||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "ConsoleContactField.h"
|
||||
#import "MXCContactField.h"
|
||||
|
||||
@interface ConsoleEmail : ConsoleContactField
|
||||
@interface MXCEmail : MXCContactField
|
||||
|
||||
// email info
|
||||
@property (nonatomic, readonly) NSString *type;
|
|
@ -14,17 +14,17 @@
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
#import "ConsoleEmail.h"
|
||||
#import "MXCEmail.h"
|
||||
#import "MatrixHandler.h"
|
||||
|
||||
#import "ConsoleContact.h"
|
||||
#import "MXCContact.h"
|
||||
|
||||
#import "MediaManager.h"
|
||||
|
||||
@interface ConsoleEmail()
|
||||
@interface MXCEmail()
|
||||
@end
|
||||
|
||||
@implementation ConsoleEmail
|
||||
@implementation MXCEmail
|
||||
|
||||
- (void) commonInit {
|
||||
// init members
|
|
@ -15,9 +15,9 @@
|
|||
*/
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "ConsoleContactField.h"
|
||||
#import "MXCContactField.h"
|
||||
|
||||
@interface ConsolePhoneNumber : ConsoleContactField
|
||||
@interface MXCPhoneNumber : MXCContactField
|
||||
|
||||
// phonenumber info
|
||||
@property (nonatomic, readonly) NSString *type;
|
|
@ -14,9 +14,9 @@
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
#import "ConsolePhoneNumber.h"
|
||||
#import "MXCPhoneNumber.h"
|
||||
|
||||
@implementation ConsolePhoneNumber
|
||||
@implementation MXCPhoneNumber
|
||||
|
||||
- (id)initWithTextNumber:(NSString*)aTextNumber type:(NSString*)aType contactID:(NSString*)aContactID matrixID:(NSString*)matrixID {
|
||||
self = [super initWithContactID:aContactID matrixID:matrixID];
|
|
@ -15,17 +15,17 @@
|
|||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "CustomImageView.h"
|
||||
#import "ConsoleContact.h"
|
||||
#import "MXCImageView.h"
|
||||
#import "MXCContact.h"
|
||||
|
||||
@interface ContactTableCell : UITableViewCell
|
||||
|
||||
@property (strong, nonatomic) IBOutlet CustomImageView *thumbnailView;
|
||||
@property (strong, nonatomic) IBOutlet MXCImageView *thumbnailView;
|
||||
@property (strong, nonatomic) IBOutlet UILabel *contactDisplayNameLabel;
|
||||
@property (strong, nonatomic) IBOutlet UIImageView *matrixUserIconView;
|
||||
|
||||
// reference to the linked message
|
||||
@property (strong, nonatomic) ConsoleContact *contact;
|
||||
@property (strong, nonatomic) MXCContact *contact;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
- (void)setContact:(ConsoleContact *)aContact {
|
||||
- (void)setContact:(MXCContact *)aContact {
|
||||
MatrixHandler *mxHandler = [MatrixHandler sharedHandler];
|
||||
|
||||
_contact = aContact;
|
||||
|
@ -52,8 +52,8 @@
|
|||
self.thumbnailView.layer.borderWidth = 0;
|
||||
|
||||
// be warned when the matrix ID and the thumbnail is updated
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onMatrixIdUpdate:) name:kConsoleContactMatrixIdentifierUpdateNotification object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onThumbnailUpdate:) name:kConsoleContactThumbnailUpdateNotification object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onMatrixIdUpdate:) name:kMXCContactMatrixIdentifierUpdateNotification object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onThumbnailUpdate:) name:kMXCContactThumbnailUpdateNotification object:nil];
|
||||
|
||||
// Register a listener for events that concern room members
|
||||
NSArray *mxMembersEvents = @[
|
||||
|
|
|
@ -24,22 +24,22 @@
|
|||
|
||||
// contacts management
|
||||
#import "ContactManager.h"
|
||||
#import "ConsoleContact.h"
|
||||
#import "ConsoleEmail.h"
|
||||
#import "ConsolePhoneNumber.h"
|
||||
#import "MXCContact.h"
|
||||
#import "MXCEmail.h"
|
||||
#import "MXCPhoneNumber.h"
|
||||
|
||||
// contact cell
|
||||
#import "ContactTableCell.h"
|
||||
|
||||
// alert
|
||||
#import "CustomAlert.h"
|
||||
#import "MXCAlert.h"
|
||||
|
||||
|
||||
|
||||
NSString *const kInvitationMessage = @"I'd like to chat with you with matrix. Please, visit the website http://matrix.org to have more information.";
|
||||
|
||||
@interface ContactsViewController ()
|
||||
@property (strong, nonatomic) CustomAlert *startChatMenu;
|
||||
@property (strong, nonatomic) MXCAlert *startChatMenu;
|
||||
@end
|
||||
|
||||
@implementation ContactsViewController
|
||||
|
@ -128,7 +128,7 @@ NSString *const kInvitationMessage = @"I'd like to chat with you with matrix. Pl
|
|||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
ContactTableCell* cell = [tableView dequeueReusableCellWithIdentifier:@"ContactCell" forIndexPath:indexPath];
|
||||
|
||||
ConsoleContact* contact = nil;
|
||||
MXCContact* contact = nil;
|
||||
|
||||
if (indexPath.section < sectionedContacts.sectionedContacts.count) {
|
||||
NSArray *thisSection = [sectionedContacts.sectionedContacts objectAtIndex:indexPath.section];
|
||||
|
@ -146,7 +146,7 @@ NSString *const kInvitationMessage = @"I'd like to chat with you with matrix. Pl
|
|||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
|
||||
ConsoleContact* contact = nil;
|
||||
MXCContact* contact = nil;
|
||||
|
||||
if (indexPath.section < sectionedContacts.sectionedContacts.count) {
|
||||
NSArray *thisSection = [sectionedContacts.sectionedContacts objectAtIndex:indexPath.section];
|
||||
|
@ -166,13 +166,13 @@ NSString *const kInvitationMessage = @"I'd like to chat with you with matrix. Pl
|
|||
|
||||
NSString* matrixID = [matrixIDs objectAtIndex:0];
|
||||
|
||||
self.startChatMenu = [[CustomAlert alloc] initWithTitle:[NSString stringWithFormat:@"Start chat with %@", matrixID] message:nil style:CustomAlertStyleAlert];
|
||||
self.startChatMenu = [[MXCAlert alloc] initWithTitle:[NSString stringWithFormat:@"Start chat with %@", matrixID] message:nil style:MXCAlertStyleAlert];
|
||||
|
||||
[self.startChatMenu addActionWithTitle:@"Cancel" style:CustomAlertActionStyleDefault handler:^(CustomAlert *alert) {
|
||||
[self.startChatMenu addActionWithTitle:@"Cancel" style:MXCAlertActionStyleDefault handler:^(MXCAlert *alert) {
|
||||
weakSelf.startChatMenu = nil;
|
||||
}];
|
||||
|
||||
[self.startChatMenu addActionWithTitle:@"OK" style:CustomAlertActionStyleDefault handler:^(CustomAlert *alert) {
|
||||
[self.startChatMenu addActionWithTitle:@"OK" style:MXCAlertActionStyleDefault handler:^(MXCAlert *alert) {
|
||||
weakSelf.startChatMenu = nil;
|
||||
|
||||
MatrixHandler *mxHandler = [MatrixHandler sharedHandler];
|
||||
|
@ -207,14 +207,14 @@ NSString *const kInvitationMessage = @"I'd like to chat with you with matrix. Pl
|
|||
// invite to use matrix
|
||||
if (([MFMessageComposeViewController canSendText] ? contact.emailAddresses.count : 0) + (contact.phoneNumbers.count > 0)) {
|
||||
|
||||
self.startChatMenu = [[CustomAlert alloc] initWithTitle:[NSString stringWithFormat:@"Invite this user to use matrix with"] message:nil style:CustomAlertStyleActionSheet];
|
||||
self.startChatMenu = [[MXCAlert alloc] initWithTitle:[NSString stringWithFormat:@"Invite this user to use matrix with"] message:nil style:MXCAlertStyleActionSheet];
|
||||
|
||||
// check if the target can send SMSes
|
||||
if ([MFMessageComposeViewController canSendText]) {
|
||||
// list phonenumbers
|
||||
for(ConsolePhoneNumber* phonenumber in contact.phoneNumbers) {
|
||||
for(MXCPhoneNumber* phonenumber in contact.phoneNumbers) {
|
||||
|
||||
[self.startChatMenu addActionWithTitle:phonenumber.textNumber style:CustomAlertActionStyleDefault handler:^(CustomAlert *alert) {
|
||||
[self.startChatMenu addActionWithTitle:phonenumber.textNumber style:MXCAlertActionStyleDefault handler:^(MXCAlert *alert) {
|
||||
weakSelf.startChatMenu = nil;
|
||||
|
||||
// launch SMS composer
|
||||
|
@ -235,9 +235,9 @@ NSString *const kInvitationMessage = @"I'd like to chat with you with matrix. Pl
|
|||
}
|
||||
|
||||
// list emails
|
||||
for(ConsoleEmail* email in contact.emailAddresses) {
|
||||
for(MXCEmail* email in contact.emailAddresses) {
|
||||
|
||||
[self.startChatMenu addActionWithTitle:email.emailAddress style:CustomAlertActionStyleDefault handler:^(CustomAlert *alert) {
|
||||
[self.startChatMenu addActionWithTitle:email.emailAddress style:MXCAlertActionStyleDefault handler:^(MXCAlert *alert) {
|
||||
weakSelf.startChatMenu = nil;
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
|
@ -250,7 +250,7 @@ NSString *const kInvitationMessage = @"I'd like to chat with you with matrix. Pl
|
|||
}];
|
||||
}
|
||||
|
||||
[self.startChatMenu addActionWithTitle:@"Cancel" style:CustomAlertActionStyleDefault handler:^(CustomAlert *alert) {
|
||||
[self.startChatMenu addActionWithTitle:@"Cancel" style:MXCAlertActionStyleDefault handler:^(MXCAlert *alert) {
|
||||
weakSelf.startChatMenu = nil;
|
||||
}];
|
||||
|
||||
|
|
Loading…
Reference in a new issue