Merge branch 'feature/5205_matrix_id' into 'develop'

MESSENGER-5205 Show matrix identifier in second line

See merge request bwmessenger/bundesmessenger/bundesmessenger-ios!296
This commit is contained in:
Arnfried Griesert
2024-01-29 12:50:32 +00:00
4 changed files with 37 additions and 23 deletions

View File

@@ -709,4 +709,6 @@ class BWIBuildSettings: NSObject {
// MARK: Backup restore
var showMatrixIDinRoomInfoScreen = false
// MARK: Contacts List
var showContactIdentifierInDetailRow = true
}

View File

@@ -594,7 +594,11 @@
[contactCell render:contact];
contactCell.selectionStyle = UITableViewCellSelectionStyleDefault;
contactCell.showMatrixIdInDisplayName = showMatrixIdInDisplayName;
if([BWIBuildSettings.shared showContactIdentifierInDetailRow]) {
contactCell.showMatrixIdInDisplayName = false;
} else {
contactCell.showMatrixIdInDisplayName = showMatrixIdInDisplayName;
}
// The search displays contacts to invite.
if (indexPath.section == filteredLocalContactsSection || indexPath.section == filteredMatrixContactsSection)

View File

@@ -199,6 +199,7 @@
[self refreshContactPresence];
[self refreshContactBadgeImage];
[self refreshLocalContactInformation];
}
else
{
@@ -323,22 +324,31 @@
{
// Display the first contact method in sub label.
NSString *subLabelText = nil;
if (contact.emailAddresses.count)
{
MXKEmail* email = contact.emailAddresses.firstObject;
subLabelText = email.emailAddress;
}
else if (contact.phoneNumbers.count)
{
MXKPhoneNumber *phoneNumber = contact.phoneNumbers.firstObject;
if (phoneNumber.nbPhoneNumber)
if(![BWIBuildSettings.shared showContactIdentifierInDetailRow]) {
if (contact.emailAddresses.count)
{
subLabelText = [[NBPhoneNumberUtil sharedInstance] format:phoneNumber.nbPhoneNumber numberFormat:NBEPhoneNumberFormatINTERNATIONAL error:nil];
MXKEmail* email = contact.emailAddresses.firstObject;
subLabelText = email.emailAddress;
}
else
else if (contact.phoneNumbers.count)
{
subLabelText = phoneNumber.textNumber;
MXKPhoneNumber *phoneNumber = contact.phoneNumbers.firstObject;
if (phoneNumber.nbPhoneNumber)
{
subLabelText = [[NBPhoneNumberUtil sharedInstance] format:phoneNumber.nbPhoneNumber numberFormat:NBEPhoneNumberFormatINTERNATIONAL error:nil];
}
else
{
subLabelText = phoneNumber.textNumber;
}
}
} else {
NSArray *identifiers = contact.matrixIdentifiers;
if (identifiers.count)
{
NSString *userId = identifiers.firstObject;
subLabelText = userId;
}
}

View File

@@ -1,11 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="22155" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22131"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@@ -15,7 +13,7 @@
<rect key="frame" x="0.0" y="0.0" width="600" height="74"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="L2L-l5-wPx" id="aXz-IR-jj5">
<rect key="frame" x="0.0" y="0.0" width="600" height="73.5"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="74"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="RX5-eD-c3c" userLabel="member avatar" customClass="MXKImageView">
@@ -31,6 +29,7 @@
<rect key="frame" x="41" y="43" width="16" height="16"/>
<constraints>
<constraint firstAttribute="width" constant="16" id="Rcc-M1-2hb"/>
<constraint firstAttribute="width" secondItem="Wg7-no-cax" secondAttribute="height" multiplier="1:1" id="sZo-F2-fpL"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" verticalHuggingPriority="251" text="Display name" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Lg1-xQ-AGn" userLabel="member display name">
@@ -48,9 +47,9 @@
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" text="info label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dQt-mN-T6b">
<rect key="frame" x="69" y="39" width="531" height="19.5"/>
<rect key="frame" x="69" y="39" width="531" height="20"/>
<accessibility key="accessibilityConfiguration" identifier="ContactInformationLabel"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleSubhead"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleCaption1"/>
<color key="textColor" red="0.66666666666666663" green="0.66666666666666663" blue="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
@@ -74,7 +73,6 @@
<constraint firstItem="RX5-eD-c3c" firstAttribute="top" secondItem="aXz-IR-jj5" secondAttribute="top" constant="15" id="mga-fG-I0L"/>
<constraint firstItem="Ogo-Qt-u2C" firstAttribute="leading" secondItem="1nR-ck-5Xd" secondAttribute="trailing" id="nbn-Je-HEE"/>
<constraint firstItem="Wg7-no-cax" firstAttribute="bottom" secondItem="RX5-eD-c3c" secondAttribute="bottom" constant="2" id="pck-mZ-FjJ"/>
<constraint firstItem="Wg7-no-cax" firstAttribute="width" secondItem="Wg7-no-cax" secondAttribute="height" multiplier="1:1" id="sZo-F2-fpL"/>
<constraint firstAttribute="trailing" secondItem="dQt-mN-T6b" secondAttribute="trailing" id="t2m-pb-5zd"/>
<constraint firstItem="Lg1-xQ-AGn" firstAttribute="top" secondItem="aXz-IR-jj5" secondAttribute="top" constant="14" id="tY3-6V-A3B"/>
<constraint firstItem="1nR-ck-5Xd" firstAttribute="leading" secondItem="Lg1-xQ-AGn" secondAttribute="trailing" constant="5" id="tat-Fj-BSw"/>