Skip to content

Commit

Permalink
Improve the people invite screens
Browse files Browse the repository at this point in the history
#904

- Discover Riot/Matrix users by using msisdn
  • Loading branch information
giomfo committed Mar 6, 2017
1 parent 715e800 commit 9bbb99e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Vector/ViewController/ContactsTableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,17 @@ - (void)onContactManagerDidUpdate:(NSNotification *)notif
continue;
}
}
else
{
// The contact has here a phone number.
// Ignore this contact if the phone number is not linked to a matrix id because the invitation by SMS is not supported yet.
MXKPhoneNumber *phoneNumber = contact.phoneNumbers.firstObject;
if (!phoneNumber.matrixID)
{
[unfilteredLocalContacts removeObjectAtIndex:index];
continue;
}
}
}

index++;
Expand Down
14 changes: 14 additions & 0 deletions Vector/Views/Contact/ContactTableViewCell.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
Copyright 2015 OpenMarket Ltd
Copyright 2017 Vector Creations Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -265,6 +266,19 @@ - (void)refreshLocalContactInformation
MXKEmail* email = contact.emailAddresses.firstObject;
subLabelText = email.emailAddress;
}
else if (contact.phoneNumbers.count)
{
MXKPhoneNumber *phoneNumber = contact.phoneNumbers.firstObject;

if (phoneNumber.nbPhoneNumber)
{
subLabelText = [[NBPhoneNumberUtil sharedInstance] format:phoneNumber.nbPhoneNumber numberFormat:NBEPhoneNumberFormatINTERNATIONAL error:nil];
}
else
{
subLabelText = phoneNumber.textNumber;
}
}
self.contactInformationLabel.text = subLabelText;
}

Expand Down

0 comments on commit 9bbb99e

Please sign in to comment.