Replace Console prefix with MXC

This commit is contained in:
giomfo 2015-01-23 14:22:02 +01:00
parent 5c3baf0180
commit 4ce33b1500
14 changed files with 95 additions and 95 deletions

View file

@ -9,13 +9,13 @@
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
710210A41A67A4B600364868 /* MXCGrowingTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 710210A31A67A4B600364868 /* MXCGrowingTextView.m */; }; 710210A41A67A4B600364868 /* MXCGrowingTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 710210A31A67A4B600364868 /* MXCGrowingTextView.m */; };
710CC3BF1A6E9F14006EE973 /* matrixUser.png in Resources */ = {isa = PBXBuildFile; fileRef = 710CC3BE1A6E9F14006EE973 /* matrixUser.png */; }; 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 */; }; 71193D241A6D64F900E59A9E /* AddressBook.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 71193D231A6D64F900E59A9E /* AddressBook.framework */; };
71193D291A6E3DC000E59A9E /* ContactsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71193D281A6E3DC000E59A9E /* ContactsViewController.m */; }; 71193D291A6E3DC000E59A9E /* ContactsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71193D281A6E3DC000E59A9E /* ContactsViewController.m */; };
71193D2C1A6E433900E59A9E /* ContactTableCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 71193D2B1A6E433900E59A9E /* ContactTableCell.m */; }; 71193D2C1A6E433900E59A9E /* ContactTableCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 71193D2B1A6E433900E59A9E /* ContactTableCell.m */; };
71193D361A6E49F000E59A9E /* ConsoleContact.m in Sources */ = {isa = PBXBuildFile; fileRef = 71193D311A6E49F000E59A9E /* ConsoleContact.m */; }; 71193D361A6E49F000E59A9E /* MXCContact.m in Sources */ = {isa = PBXBuildFile; fileRef = 71193D311A6E49F000E59A9E /* MXCContact.m */; };
71193D371A6E49F000E59A9E /* ConsoleEmail.m in Sources */ = {isa = PBXBuildFile; fileRef = 71193D331A6E49F000E59A9E /* ConsoleEmail.m */; }; 71193D371A6E49F000E59A9E /* MXCEmail.m in Sources */ = {isa = PBXBuildFile; fileRef = 71193D331A6E49F000E59A9E /* MXCEmail.m */; };
71193D381A6E49F000E59A9E /* ConsolePhoneNumber.m in Sources */ = {isa = PBXBuildFile; fileRef = 71193D351A6E49F000E59A9E /* ConsolePhoneNumber.m */; }; 71193D381A6E49F000E59A9E /* MXCPhoneNumber.m in Sources */ = {isa = PBXBuildFile; fileRef = 71193D351A6E49F000E59A9E /* MXCPhoneNumber.m */; };
71193D3B1A6E50EC00E59A9E /* ContactManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 71193D3A1A6E50EC00E59A9E /* ContactManager.m */; }; 71193D3B1A6E50EC00E59A9E /* ContactManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 71193D3A1A6E50EC00E59A9E /* ContactManager.m */; };
71193D3E1A6E61AD00E59A9E /* SectionedContacts.m in Sources */ = {isa = PBXBuildFile; fileRef = 71193D3D1A6E61AD00E59A9E /* SectionedContacts.m */; }; 71193D3E1A6E61AD00E59A9E /* SectionedContacts.m in Sources */ = {isa = PBXBuildFile; fileRef = 71193D3D1A6E61AD00E59A9E /* SectionedContacts.m */; };
71D2E4EC1A49814B000DE015 /* RoomMemberActionsCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 71D2E4EB1A49814B000DE015 /* RoomMemberActionsCell.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>"; }; 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>"; }; 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>"; }; 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>"; }; 710CC3C01A70F28F006EE973 /* MXCContactField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MXCContactField.h; sourceTree = "<group>"; };
710CC3C11A70F28F006EE973 /* ConsoleContactField.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ConsoleContactField.m; 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; }; 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>"; }; 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>"; }; 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>"; }; 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>"; }; 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>"; }; 71193D301A6E49F000E59A9E /* MXCContact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MXCContact.h; sourceTree = "<group>"; };
71193D311A6E49F000E59A9E /* ConsoleContact.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ConsoleContact.m; sourceTree = "<group>"; }; 71193D311A6E49F000E59A9E /* MXCContact.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MXCContact.m; sourceTree = "<group>"; };
71193D321A6E49F000E59A9E /* ConsoleEmail.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConsoleEmail.h; sourceTree = "<group>"; }; 71193D321A6E49F000E59A9E /* MXCEmail.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MXCEmail.h; sourceTree = "<group>"; };
71193D331A6E49F000E59A9E /* ConsoleEmail.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ConsoleEmail.m; sourceTree = "<group>"; }; 71193D331A6E49F000E59A9E /* MXCEmail.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MXCEmail.m; sourceTree = "<group>"; };
71193D341A6E49F000E59A9E /* ConsolePhoneNumber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConsolePhoneNumber.h; sourceTree = "<group>"; }; 71193D341A6E49F000E59A9E /* MXCPhoneNumber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MXCPhoneNumber.h; sourceTree = "<group>"; };
71193D351A6E49F000E59A9E /* ConsolePhoneNumber.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ConsolePhoneNumber.m; 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>"; }; 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>"; }; 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>"; }; 71193D3C1A6E61AD00E59A9E /* SectionedContacts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SectionedContacts.h; sourceTree = "<group>"; };
@ -309,16 +309,16 @@
F0465AF71A251F85003639F9 /* Model */ = { F0465AF71A251F85003639F9 /* Model */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
71193D301A6E49F000E59A9E /* ConsoleContact.h */, 71193D301A6E49F000E59A9E /* MXCContact.h */,
71193D311A6E49F000E59A9E /* ConsoleContact.m */, 71193D311A6E49F000E59A9E /* MXCContact.m */,
710CC3C01A70F28F006EE973 /* ConsoleContactField.h */, 710CC3C01A70F28F006EE973 /* MXCContactField.h */,
710CC3C11A70F28F006EE973 /* ConsoleContactField.m */, 710CC3C11A70F28F006EE973 /* MXCContactField.m */,
71193D321A6E49F000E59A9E /* ConsoleEmail.h */, 71193D321A6E49F000E59A9E /* MXCEmail.h */,
71193D331A6E49F000E59A9E /* ConsoleEmail.m */, 71193D331A6E49F000E59A9E /* MXCEmail.m */,
710210A21A67A4B600364868 /* MXCGrowingTextView.h */, 710210A21A67A4B600364868 /* MXCGrowingTextView.h */,
710210A31A67A4B600364868 /* MXCGrowingTextView.m */, 710210A31A67A4B600364868 /* MXCGrowingTextView.m */,
71193D341A6E49F000E59A9E /* ConsolePhoneNumber.h */, 71193D341A6E49F000E59A9E /* MXCPhoneNumber.h */,
71193D351A6E49F000E59A9E /* ConsolePhoneNumber.m */, 71193D351A6E49F000E59A9E /* MXCPhoneNumber.m */,
F0D942F41A31F3A300826CC1 /* RecentRoom.h */, F0D942F41A31F3A300826CC1 /* RecentRoom.h */,
F0D942F51A31F3A300826CC1 /* RecentRoom.m */, F0D942F51A31F3A300826CC1 /* RecentRoom.m */,
F0465AF81A251F85003639F9 /* RoomMessage.h */, F0465AF81A251F85003639F9 /* RoomMessage.h */,
@ -559,14 +559,14 @@
F07A80DB19DD9DE700B621A1 /* AppDelegate.m in Sources */, F07A80DB19DD9DE700B621A1 /* AppDelegate.m in Sources */,
F03EF5FF19F1762000A0EE52 /* RoomMessageTableCell.m in Sources */, F03EF5FF19F1762000A0EE52 /* RoomMessageTableCell.m in Sources */,
F07A80D819DD9DE700B621A1 /* main.m in Sources */, F07A80D819DD9DE700B621A1 /* main.m in Sources */,
71193D371A6E49F000E59A9E /* ConsoleEmail.m in Sources */, 71193D371A6E49F000E59A9E /* MXCEmail.m in Sources */,
F05B955F19DEED8A008761B0 /* MatrixHandler.m in Sources */, F05B955F19DEED8A008761B0 /* MatrixHandler.m in Sources */,
71193D3E1A6E61AD00E59A9E /* SectionedContacts.m in Sources */, 71193D3E1A6E61AD00E59A9E /* SectionedContacts.m in Sources */,
F021FBEF1A5EF57300EA3AE6 /* MediaLoader.m in Sources */, F021FBEF1A5EF57300EA3AE6 /* MediaLoader.m in Sources */,
F03EF5FB19F171EB00A0EE52 /* SettingsViewController.m in Sources */, F03EF5FB19F171EB00A0EE52 /* SettingsViewController.m in Sources */,
F02900BB1A63C71E00356F7D /* MXCTools.m in Sources */, F02900BB1A63C71E00356F7D /* MXCTools.m in Sources */,
71193D361A6E49F000E59A9E /* ConsoleContact.m in Sources */, 71193D361A6E49F000E59A9E /* MXCContact.m in Sources */,
710CC3C21A70F28F006EE973 /* ConsoleContactField.m in Sources */, 710CC3C21A70F28F006EE973 /* MXCContactField.m in Sources */,
F01A0FF31A27314B009FAE2F /* RoomMessageComponent.m in Sources */, F01A0FF31A27314B009FAE2F /* RoomMessageComponent.m in Sources */,
F03EF5FA19F171EB00A0EE52 /* RoomViewController.m in Sources */, F03EF5FA19F171EB00A0EE52 /* RoomViewController.m in Sources */,
F03EF5F819F171EB00A0EE52 /* MasterTabBarController.m in Sources */, F03EF5F819F171EB00A0EE52 /* MasterTabBarController.m in Sources */,
@ -582,7 +582,7 @@
71193D291A6E3DC000E59A9E /* ContactsViewController.m in Sources */, 71193D291A6E3DC000E59A9E /* ContactsViewController.m in Sources */,
F03C47111A02952800E445AB /* MXCAlert.m in Sources */, F03C47111A02952800E445AB /* MXCAlert.m in Sources */,
F0E84D401A1F9AEC005F2E42 /* RecentsTableViewCell.m in Sources */, F0E84D401A1F9AEC005F2E42 /* RecentsTableViewCell.m in Sources */,
71193D381A6E49F000E59A9E /* ConsolePhoneNumber.m in Sources */, 71193D381A6E49F000E59A9E /* MXCPhoneNumber.m in Sources */,
71193D3B1A6E50EC00E59A9E /* ContactManager.m in Sources */, 71193D3B1A6E50EC00E59A9E /* ContactManager.m in Sources */,
71193D2C1A6E433900E59A9E /* ContactTableCell.m in Sources */, 71193D2C1A6E433900E59A9E /* ContactTableCell.m in Sources */,
F02D707619F1DC9E007B47D3 /* RoomMemberTableCell.m in Sources */, F02D707619F1DC9E007B47D3 /* RoomMemberTableCell.m in Sources */,

View file

@ -16,9 +16,9 @@
#import "ContactManager.h" #import "ContactManager.h"
#import "ConsoleContact.h" #import "MXCContact.h"
#import "ConsolePhoneNumber.h" #import "MXCPhoneNumber.h"
#import "ConsoleEmail.h" #import "MXCEmail.h"
#import "MatrixHandler.h" #import "MatrixHandler.h"
@ -103,7 +103,7 @@ static ContactManager* sharedContactManager = nil;
for (index = 0; index < peopleCount; index++) { for (index = 0; index < peopleCount; index++) {
contactRecord = (ABRecordRef)CFArrayGetValueAtIndex(people, index); contactRecord = (ABRecordRef)CFArrayGetValueAtIndex(people, index);
[contactsList addObject:[[ConsoleContact alloc] initWithABRecord:contactRecord]]; [contactsList addObject:[[MXCContact alloc] initWithABRecord:contactRecord]];
} }
CFRelease(people); CFRelease(people);
@ -128,7 +128,7 @@ static ContactManager* sharedContactManager = nil;
NSMutableArray* pids = [[NSMutableArray alloc] init]; NSMutableArray* pids = [[NSMutableArray alloc] init];
NSMutableArray* medias = [[NSMutableArray alloc] init]; NSMutableArray* medias = [[NSMutableArray alloc] init];
for(ConsoleContact* contact in contacts) { for(MXCContact* contact in contacts) {
// the phonenumbers are not managed // the phonenumbers are not managed
/*for(ConsolePhoneNumber* pn in contact.phoneNumbers) { /*for(ConsolePhoneNumber* pn in contact.phoneNumbers) {
if (pn.textNumber.length > 0) { 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) { if (email.emailAddress.length > 0) {
// not yet added // not yet added
@ -166,7 +166,7 @@ static ContactManager* sharedContactManager = nil;
matrixIDBy3PID = [[NSMutableDictionary alloc] initWithObjects:userIds forKeys:pids]; matrixIDBy3PID = [[NSMutableDictionary alloc] initWithObjects:userIds forKeys:pids];
for(ConsoleContact* contact in contacts) { for(MXCContact* contact in contacts) {
// the phonenumbers wil be managed later // the phonenumbers wil be managed later
/*for(ConsolePhoneNumber* pn in contact.phoneNumbers) { /*for(ConsolePhoneNumber* pn in contact.phoneNumbers) {
if (pn.textNumber.length > 0) { 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) { if (email.emailAddress.length > 0) {
id matrixID = [matrixIDBy3PID valueForKey:email.emailAddress]; id matrixID = [matrixIDBy3PID valueForKey:email.emailAddress];
@ -206,8 +206,8 @@ static ContactManager* sharedContactManager = nil;
NSString* dummyContactID = [NSString stringWithFormat:@"%lu", (unsigned long)user.userId.hash]; 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 // 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]; MXCEmail* email = [[MXCEmail 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]; MXCContact* contact = [[MXCContact alloc] initWithDisplayName:(user.displayname ? user.displayname : user.userId) contactID:dummyContactID emails:@[email] phonenumbers:nil];
[unknownRoomContacts addObject:contact]; [unknownRoomContacts addObject:contact];
} }
@ -251,7 +251,7 @@ static ContactManager* sharedContactManager = nil;
int contactsCount = 0; int contactsCount = 0;
for (ConsoleContact *aContact in contactsList) for (MXCContact *aContact in contactsList)
{ {
NSInteger section = [collation sectionForObject:aContact collationStringSelector:@selector(displayName)] + indexOffset; NSInteger section = [collation sectionForObject:aContact collationStringSelector:@selector(displayName)] + indexOffset;

View file

@ -1371,7 +1371,7 @@
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Qu4-km-MZA" id="uEH-gd-MNN"> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Qu4-km-MZA" id="uEH-gd-MNN">
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<subviews> <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"/> <rect key="frame" x="12" y="5" width="40" height="40"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<color key="tintColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> <color key="tintColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>

View file

@ -19,12 +19,12 @@
// warn when a contact has a new matrix identifier // warn when a contact has a new matrix identifier
// the contactID is provided in parameter // the contactID is provided in parameter
extern NSString *const kConsoleContactMatrixIdentifierUpdateNotification; extern NSString *const kMXCContactMatrixIdentifierUpdateNotification;
// warn when the contact thumbnail is updated // warn when the contact thumbnail is updated
// the contactID is provided in parameter // the contactID is provided in parameter
extern NSString *const kConsoleContactThumbnailUpdateNotification; extern NSString *const kMXCContactThumbnailUpdateNotification;
@interface ConsoleContact : NSObject @interface MXCContact : NSObject
// unique identifier // unique identifier
@property (nonatomic, readonly) NSString * contactID; @property (nonatomic, readonly) NSString * contactID;
@ -32,9 +32,9 @@ extern NSString *const kConsoleContactThumbnailUpdateNotification;
@property (nonatomic, readonly) NSString *displayName; @property (nonatomic, readonly) NSString *displayName;
// contact thumbnail // contact thumbnail
@property (nonatomic, copy, readonly) UIImage *thumbnail; @property (nonatomic, copy, readonly) UIImage *thumbnail;
// array of ConsolePhoneNumber // array of MXCPhoneNumber
@property (nonatomic, readonly) NSArray *phoneNumbers; @property (nonatomic, readonly) NSArray *phoneNumbers;
// array of ConsoleEmail // array of MXCEmail
@property (nonatomic, readonly) NSArray *emailAddresses; @property (nonatomic, readonly) NSArray *emailAddresses;
// array of matrix identifiers // array of matrix identifiers
@property (nonatomic, readonly) NSArray* matrixIdentifiers; @property (nonatomic, readonly) NSArray* matrixIdentifiers;

View file

@ -14,26 +14,26 @@
limitations under the License. limitations under the License.
*/ */
#import "ConsoleContact.h" #import "MXCContact.h"
#import "ConsoleEmail.h" #import "MXCEmail.h"
#import "ConsolePhoneNumber.h" #import "MXCPhoneNumber.h"
// warn when a contact has a new matrix identifier // warn when a contact has a new matrix identifier
// the contactID is provided in parameter // the contactID is provided in parameter
NSString *const kConsoleContactMatrixIdentifierUpdateNotification = @"kConsoleContactMatrixIdentifierUpdateNotification"; NSString *const kMXCContactMatrixIdentifierUpdateNotification = @"kMXCContactMatrixIdentifierUpdateNotification";
// warn when the contact thumbnail is updated // warn when the contact thumbnail is updated
// the contactID is provided in parameter // the contactID is provided in parameter
NSString *const kConsoleContactThumbnailUpdateNotification = @"kConsoleContactThumbnailUpdateNotification"; NSString *const kMXCContactThumbnailUpdateNotification = @"kMXCContactThumbnailUpdateNotification";
@interface ConsoleContact() { @interface MXCContact() {
UIImage* contactBookThumbnail; UIImage* contactBookThumbnail;
UIImage* matrixThumbnail; UIImage* matrixThumbnail;
} }
@end @end
@implementation ConsoleContact @implementation MXCContact
- (id) initWithABRecord:(ABRecordRef)record { - (id) initWithABRecord:(ABRecordRef)record {
self = [super init]; 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) { if (lblRef) {
CFRelease(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) { if (lblRef) {
CFRelease(lblRef); CFRelease(lblRef);
@ -194,13 +194,13 @@ NSString *const kConsoleContactThumbnailUpdateNotification = @"kConsoleContactTh
- (NSArray*) matrixIdentifiers { - (NSArray*) matrixIdentifiers {
NSMutableArray* identifiers = [[NSMutableArray alloc] init]; NSMutableArray* identifiers = [[NSMutableArray alloc] init];
for(ConsoleEmail* email in _emailAddresses) { for(MXCEmail* email in _emailAddresses) {
if (email.matrixID && ([identifiers indexOfObject:email.matrixID] == NSNotFound)) { if (email.matrixID && ([identifiers indexOfObject:email.matrixID] == NSNotFound)) {
[identifiers addObject:email.matrixID]; [identifiers addObject:email.matrixID];
} }
} }
for(ConsolePhoneNumber* pn in _phoneNumbers) { for(MXCPhoneNumber* pn in _phoneNumbers) {
if (pn.matrixID && ([identifiers indexOfObject:pn.matrixID] == NSNotFound)) { if (pn.matrixID && ([identifiers indexOfObject:pn.matrixID] == NSNotFound)) {
[identifiers addObject:pn.matrixID]; [identifiers addObject:pn.matrixID];
} }
@ -222,11 +222,11 @@ NSString *const kConsoleContactThumbnailUpdateNotification = @"kConsoleContactTh
// try to replace the thumbnail by the matrix one // try to replace the thumbnail by the matrix one
if (_emailAddresses.count > 0) { if (_emailAddresses.count > 0) {
// //
ConsoleEmail* firstEmail = nil; MXCEmail* firstEmail = nil;
// list the linked email // list the linked email
// search if one email field has a dedicated thumbnail // search if one email field has a dedicated thumbnail
for(ConsoleEmail* email in _emailAddresses) { for(MXCEmail* email in _emailAddresses) {
if (email.avatarImage) { if (email.avatarImage) {
matrixThumbnail = email.avatarImage; matrixThumbnail = email.avatarImage;
return matrixThumbnail; return matrixThumbnail;

View file

@ -16,7 +16,7 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
@interface ConsoleContactField : NSObject @interface MXCContactField : NSObject
// contact ID where the email has been found // contact ID where the email has been found
@property (nonatomic, readonly) NSString *contactID; @property (nonatomic, readonly) NSString *contactID;

View file

@ -14,10 +14,10 @@
limitations under the License. limitations under the License.
*/ */
#import "ConsoleContactField.h" #import "MXCContactField.h"
// wanr when there is a contact update // wanr when there is a contact update
#import "ConsoleContact.h" #import "MXCContact.h"
// image URL // image URL
#import "MatrixHandler.h" #import "MatrixHandler.h"
@ -26,12 +26,12 @@
#import "MediaManager.h" #import "MediaManager.h"
@interface ConsoleContactField() { @interface MXCContactField() {
NSString* avatarURL; NSString* avatarURL;
} }
@end @end
@implementation ConsoleContactField @implementation MXCContactField
- (void) fieldInit { - (void) fieldInit {
// init members // init members
@ -63,7 +63,7 @@
_matrixID = aMatrixID; _matrixID = aMatrixID;
dispatch_async(dispatch_get_main_queue(), ^{ 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 // the image is already in the cache
if (_avatarImage) { if (_avatarImage) {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
[[NSNotificationCenter defaultCenter] postNotificationName:kConsoleContactThumbnailUpdateNotification object:_contactID userInfo:nil]; [[NSNotificationCenter defaultCenter] postNotificationName:kMXCContactThumbnailUpdateNotification object:_contactID userInfo:nil];
}); });
} else { } else {
MediaLoader* loader = [MediaManager existingDownloaderForURL:avatarURL inFolder:kMediaManagerThumbnailFolder]; MediaLoader* loader = [MediaManager existingDownloaderForURL:avatarURL inFolder:kMediaManagerThumbnailFolder];
@ -153,7 +153,7 @@
_avatarImage = image; _avatarImage = image;
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
[[NSNotificationCenter defaultCenter] postNotificationName:kConsoleContactThumbnailUpdateNotification object:_contactID userInfo:nil]; [[NSNotificationCenter defaultCenter] postNotificationName:kMXCContactThumbnailUpdateNotification object:_contactID userInfo:nil];
}); });
} }
} }

View file

@ -15,9 +15,9 @@
*/ */
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "ConsoleContactField.h" #import "MXCContactField.h"
@interface ConsoleEmail : ConsoleContactField @interface MXCEmail : MXCContactField
// email info // email info
@property (nonatomic, readonly) NSString *type; @property (nonatomic, readonly) NSString *type;

View file

@ -14,17 +14,17 @@
limitations under the License. limitations under the License.
*/ */
#import "ConsoleEmail.h" #import "MXCEmail.h"
#import "MatrixHandler.h" #import "MatrixHandler.h"
#import "ConsoleContact.h" #import "MXCContact.h"
#import "MediaManager.h" #import "MediaManager.h"
@interface ConsoleEmail() @interface MXCEmail()
@end @end
@implementation ConsoleEmail @implementation MXCEmail
- (void) commonInit { - (void) commonInit {
// init members // init members

View file

@ -15,9 +15,9 @@
*/ */
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import "ConsoleContactField.h" #import "MXCContactField.h"
@interface ConsolePhoneNumber : ConsoleContactField @interface MXCPhoneNumber : MXCContactField
// phonenumber info // phonenumber info
@property (nonatomic, readonly) NSString *type; @property (nonatomic, readonly) NSString *type;

View file

@ -14,9 +14,9 @@
limitations under the License. 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 { - (id)initWithTextNumber:(NSString*)aTextNumber type:(NSString*)aType contactID:(NSString*)aContactID matrixID:(NSString*)matrixID {
self = [super initWithContactID:aContactID matrixID:matrixID]; self = [super initWithContactID:aContactID matrixID:matrixID];

View file

@ -15,17 +15,17 @@
*/ */
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "CustomImageView.h" #import "MXCImageView.h"
#import "ConsoleContact.h" #import "MXCContact.h"
@interface ContactTableCell : UITableViewCell @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 UILabel *contactDisplayNameLabel;
@property (strong, nonatomic) IBOutlet UIImageView *matrixUserIconView; @property (strong, nonatomic) IBOutlet UIImageView *matrixUserIconView;
// reference to the linked message // reference to the linked message
@property (strong, nonatomic) ConsoleContact *contact; @property (strong, nonatomic) MXCContact *contact;
@end @end

View file

@ -36,7 +36,7 @@
} }
} }
- (void)setContact:(ConsoleContact *)aContact { - (void)setContact:(MXCContact *)aContact {
MatrixHandler *mxHandler = [MatrixHandler sharedHandler]; MatrixHandler *mxHandler = [MatrixHandler sharedHandler];
_contact = aContact; _contact = aContact;
@ -52,8 +52,8 @@
self.thumbnailView.layer.borderWidth = 0; self.thumbnailView.layer.borderWidth = 0;
// be warned when the matrix ID and the thumbnail is updated // 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(onMatrixIdUpdate:) name:kMXCContactMatrixIdentifierUpdateNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onThumbnailUpdate:) name:kConsoleContactThumbnailUpdateNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onThumbnailUpdate:) name:kMXCContactThumbnailUpdateNotification object:nil];
// Register a listener for events that concern room members // Register a listener for events that concern room members
NSArray *mxMembersEvents = @[ NSArray *mxMembersEvents = @[

View file

@ -24,22 +24,22 @@
// contacts management // contacts management
#import "ContactManager.h" #import "ContactManager.h"
#import "ConsoleContact.h" #import "MXCContact.h"
#import "ConsoleEmail.h" #import "MXCEmail.h"
#import "ConsolePhoneNumber.h" #import "MXCPhoneNumber.h"
// contact cell // contact cell
#import "ContactTableCell.h" #import "ContactTableCell.h"
// alert // 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."; 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 () @interface ContactsViewController ()
@property (strong, nonatomic) CustomAlert *startChatMenu; @property (strong, nonatomic) MXCAlert *startChatMenu;
@end @end
@implementation ContactsViewController @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 { - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
ContactTableCell* cell = [tableView dequeueReusableCellWithIdentifier:@"ContactCell" forIndexPath:indexPath]; ContactTableCell* cell = [tableView dequeueReusableCellWithIdentifier:@"ContactCell" forIndexPath:indexPath];
ConsoleContact* contact = nil; MXCContact* contact = nil;
if (indexPath.section < sectionedContacts.sectionedContacts.count) { if (indexPath.section < sectionedContacts.sectionedContacts.count) {
NSArray *thisSection = [sectionedContacts.sectionedContacts objectAtIndex:indexPath.section]; 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 { - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES]; [tableView deselectRowAtIndexPath:indexPath animated:YES];
ConsoleContact* contact = nil; MXCContact* contact = nil;
if (indexPath.section < sectionedContacts.sectionedContacts.count) { if (indexPath.section < sectionedContacts.sectionedContacts.count) {
NSArray *thisSection = [sectionedContacts.sectionedContacts objectAtIndex:indexPath.section]; 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]; 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; weakSelf.startChatMenu = nil;
}]; }];
[self.startChatMenu addActionWithTitle:@"OK" style:CustomAlertActionStyleDefault handler:^(CustomAlert *alert) { [self.startChatMenu addActionWithTitle:@"OK" style:MXCAlertActionStyleDefault handler:^(MXCAlert *alert) {
weakSelf.startChatMenu = nil; weakSelf.startChatMenu = nil;
MatrixHandler *mxHandler = [MatrixHandler sharedHandler]; 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 // invite to use matrix
if (([MFMessageComposeViewController canSendText] ? contact.emailAddresses.count : 0) + (contact.phoneNumbers.count > 0)) { 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 // check if the target can send SMSes
if ([MFMessageComposeViewController canSendText]) { if ([MFMessageComposeViewController canSendText]) {
// list phonenumbers // 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; weakSelf.startChatMenu = nil;
// launch SMS composer // launch SMS composer
@ -235,9 +235,9 @@ NSString *const kInvitationMessage = @"I'd like to chat with you with matrix. Pl
} }
// list emails // 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; weakSelf.startChatMenu = nil;
dispatch_async(dispatch_get_main_queue(), ^{ 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; weakSelf.startChatMenu = nil;
}]; }];