Contact request: remove msg

Remove view to display msg for pending contact request list

Change-Id: I695061d2d8840da5f5691d4f6e992439a7a4c2b0
Reviewed-by: Anthony LĂ©onard <anthony.leonard@savoirfairelinux.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6e15b51..407bb5f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -205,8 +205,6 @@
    src/views/IMTableCellView.mm
    src/views/AccountMenuItemView.h
    src/views/AccountMenuItemView.mm
-   src/views/ContactRequestCellView.h
-   src/views/ContactRequestCellView.mm
    src/views/RoundedTextField.h
    src/views/RoundedTextField.mm
    src/views/MessageBubbleView.h
diff --git a/src/ContactRequestsListVC.mm b/src/ContactRequestsListVC.mm
index 09ac4a5..019bdcf 100644
--- a/src/ContactRequestsListVC.mm
+++ b/src/ContactRequestsListVC.mm
@@ -34,7 +34,6 @@
 #import "ContactRequestsListVC.h"
 #import "QNSTreeController.h"
 #import <interfaces/pixmapmanipulatori.h>
-#import "views/ContactRequestCellView.h"
 
 @interface ContactRequestsListVC ()
 
@@ -59,7 +58,6 @@
 NSInteger const TAG_RINGID      =   200;
 NSInteger const TAG_PHOTO       =   300;
 
-NSString* defaultMsg = @"Hello, I would like invite you";
 
 
 - (void)awakeFromNib
@@ -130,23 +128,17 @@
 
 - (NSView *)outlineView:(NSOutlineView *)outlineView viewForTableColumn:(NSTableColumn *)tableColumn item:(id)item
 {
-    ContactRequestCellView* result;
-    result = [outlineView makeViewWithIdentifier:@"ContactRequestView" owner:self];
+    NSTableCellView* result = [outlineView makeViewWithIdentifier:@"ContactRequestView" owner:self];
 
     QModelIndex qIdx = [self.requestsTreeController toQIdx:((NSTreeNode*)item)];
     if(!qIdx.isValid()) {
         return result;
     }
 
-    [result setup];
     NSTextField* nameLabel = [result viewWithTag:TAG_NAME];
     NSTextField* ringIDLabel = [result viewWithTag:TAG_RINGID];
     NSImageView* photoView = [result viewWithTag:TAG_PHOTO];
 
-    NSString* localizedTitle = [NSString stringWithFormat:
-                                NSLocalizedString(@"Hi %@. Please add me to your contact list.", @"Default contact request msg"), [self nameForAccount:[self chosenAccount]]];
-    [result.msgView setString:localizedTitle];
-
     ContactRequest* contactRequest = qvariant_cast<ContactRequest*>(qIdx.data((int)Ring::Role::Object));
     Person* person = contactRequest->peer();
     if(!person) {
@@ -180,15 +172,4 @@
     return index.data(static_cast<int>(Account::Role::Object)).value<Account*>();
 }
 
--(NSString*) nameForAccount:(Account*) account {
-    auto name = account->registeredName();
-    NSString* userNameString = nullptr;
-    if (!name.isNull() && !name.isEmpty()) {
-        userNameString = name.toNSString();
-    } else {
-        userNameString = account->username().toNSString();
-    }
-    return userNameString;
-}
-
 @end
diff --git a/src/views/ContactRequestCellView.h b/src/views/ContactRequestCellView.h
deleted file mode 100644
index e2fd903..0000000
--- a/src/views/ContactRequestCellView.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- *  Copyright (C) 2015-2017 Savoir-faire Linux Inc.
- *  Author: Kateryna Kostiuk <kateryna.kostiuk@savoirfairelinux.com>
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 3 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA.
- */
-
-#import <Cocoa/Cocoa.h>
-
-@interface ContactRequestCellView : NSTableCellView
-
-@property (nonatomic, strong) IBOutlet NSTextView* msgView;
-
-- (void) setup;
-
-@end
diff --git a/src/views/ContactRequestCellView.mm b/src/views/ContactRequestCellView.mm
deleted file mode 100644
index 4f4dc2a..0000000
--- a/src/views/ContactRequestCellView.mm
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- *  Copyright (C) 2015-2017 Savoir-faire Linux Inc.
- *  Author: Kateryna Kostiuk <kateryna.kostiuk@savoirfairelinux.com>
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 3 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA.
- */
-
-#import "ContactRequestCellView.h"
-
-@implementation ContactRequestCellView
-
-@synthesize msgView;
-
-- (void) setup
-{
-    [self.msgView setWantsLayer:YES];
-    self.msgView.layer.cornerRadius = 5.0f;
-}
-
-@end
diff --git a/ui/Base.lproj/ContactRequestList.xib b/ui/Base.lproj/ContactRequestList.xib
index 6299a3c..dfb1ed5 100644
--- a/ui/Base.lproj/ContactRequestList.xib
+++ b/ui/Base.lproj/ContactRequestList.xib
@@ -29,13 +29,13 @@
                         <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
                     </textFieldCell>
                 </textField>
-                <scrollView borderType="none" autohidesScrollers="YES" horizontalLineScroll="136" horizontalPageScroll="10" verticalLineScroll="136" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gxk-zX-eFt">
+                <scrollView borderType="none" autohidesScrollers="YES" horizontalLineScroll="102" horizontalPageScroll="10" verticalLineScroll="102" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gxk-zX-eFt">
                     <rect key="frame" x="0.0" y="0.0" width="415" height="272"/>
                     <clipView key="contentView" drawsBackground="NO" copiesOnScroll="NO" id="af8-Yh-6rG">
                         <rect key="frame" x="0.0" y="0.0" width="415" height="272"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
-                            <outlineView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" multipleSelection="NO" emptySelection="NO" autosaveColumns="NO" typeSelect="NO" enabled="NO" rowHeight="134" rowSizeStyle="automatic" viewBased="YES" outlineTableColumn="gQB-z6-2iR" id="u9m-Hp-VFu">
+                            <outlineView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" multipleSelection="NO" emptySelection="NO" autosaveColumns="NO" typeSelect="NO" enabled="NO" rowHeight="100" rowSizeStyle="automatic" viewBased="YES" outlineTableColumn="gQB-z6-2iR" id="u9m-Hp-VFu">
                                 <rect key="frame" x="1" y="0.0" width="415" height="272"/>
                                 <autoresizingMask key="autoresizingMask"/>
                                 <size key="intercellSpacing" width="3" height="2"/>
@@ -55,12 +55,12 @@
                                         </textFieldCell>
                                         <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
                                         <prototypeCellViews>
-                                            <tableCellView identifier="ContactRequestView" id="auA-QD-eI4" customClass="ContactRequestCellView">
-                                                <rect key="frame" x="1" y="1" width="412" height="134"/>
+                                            <tableCellView identifier="ContactRequestView" id="auA-QD-eI4">
+                                                <rect key="frame" x="1" y="1" width="412" height="100"/>
                                                 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                                 <subviews>
                                                     <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" tag="100" allowsCharacterPickerTouchBarItem="NO" translatesAutoresizingMaskIntoConstraints="NO" id="z8C-93-gRy" userLabel="Name">
-                                                        <rect key="frame" x="45" y="104" width="4" height="20"/>
+                                                        <rect key="frame" x="45" y="70" width="357" height="20"/>
                                                         <constraints>
                                                             <constraint firstAttribute="height" constant="20" id="NjU-ft-QmJ"/>
                                                         </constraints>
@@ -71,7 +71,7 @@
                                                         </textFieldCell>
                                                     </textField>
                                                     <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" tag="300" translatesAutoresizingMaskIntoConstraints="NO" id="8H3-LL-pKv">
-                                                        <rect key="frame" x="3" y="87" width="40" height="40"/>
+                                                        <rect key="frame" x="3" y="53" width="40" height="40"/>
                                                         <constraints>
                                                             <constraint firstAttribute="height" constant="40" id="OqR-zi-5xv"/>
                                                             <constraint firstAttribute="width" constant="40" id="TIc-Wq-1i3"/>
@@ -79,7 +79,7 @@
                                                         <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" id="gm5-Ch-3WC"/>
                                                     </imageView>
                                                     <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" tag="200" allowsCharacterPickerTouchBarItem="NO" translatesAutoresizingMaskIntoConstraints="NO" id="I1j-wy-Idd" userLabel="Id">
-                                                        <rect key="frame" x="54" y="107" width="4" height="14"/>
+                                                        <rect key="frame" x="45" y="51" width="357" height="14"/>
                                                         <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" placeholderString="" drawsBackground="YES" id="eyK-YI-g07">
                                                             <font key="font" metaFont="smallSystem"/>
                                                             <color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
@@ -117,45 +117,6 @@
                                                     <box verticalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="lwB-Po-Omx">
                                                         <rect key="frame" x="14" y="9" width="395" height="5"/>
                                                     </box>
-                                                    <scrollView wantsLayer="YES" borderType="none" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" hasVerticalScroller="NO" usesPredominantAxisScrolling="NO" horizontalScrollElasticity="none" findBarPosition="belowContent" translatesAutoresizingMaskIntoConstraints="NO" id="Vgg-xb-RNp">
-                                                        <rect key="frame" x="103" y="44" width="299" height="53"/>
-                                                        <clipView key="contentView" id="9Ny-tl-rSO">
-                                                            <rect key="frame" x="0.0" y="0.0" width="299" height="53"/>
-                                                            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                                            <subviews>
-                                                                <textView editable="NO" importsGraphics="NO" usesFontPanel="YES" findStyle="panel" continuousSpellChecking="YES" allowsUndo="YES" usesRuler="YES" allowsNonContiguousLayout="YES" quoteSubstitution="YES" dashSubstitution="YES" spellingCorrection="YES" smartInsertDelete="YES" id="izN-no-Boc">
-                                                                    <rect key="frame" x="0.0" y="-1" width="299" height="53"/>
-                                                                    <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                                                    <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
-                                                                    <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
-                                                                    <size key="minSize" width="299" height="53"/>
-                                                                    <size key="maxSize" width="463" height="10000000"/>
-                                                                    <attributedString key="textStorage">
-                                                                        <fragment content="Hello">
-                                                                            <attributes>
-                                                                                <color key="NSColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
-                                                                                <font key="NSFont" metaFont="system"/>
-                                                                                <paragraphStyle key="NSParagraphStyle" alignment="left" lineBreakMode="wordWrapping" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/>
-                                                                            </attributes>
-                                                                        </fragment>
-                                                                    </attributedString>
-                                                                    <color key="insertionPointColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
-                                                                </textView>
-                                                            </subviews>
-                                                            <color key="backgroundColor" name="windowBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                                        </clipView>
-                                                        <constraints>
-                                                            <constraint firstAttribute="height" constant="53" id="aww-KT-ghR"/>
-                                                        </constraints>
-                                                        <scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="YES" id="WVx-xB-4e9">
-                                                            <rect key="frame" x="-100" y="-100" width="87" height="18"/>
-                                                            <autoresizingMask key="autoresizingMask"/>
-                                                        </scroller>
-                                                        <scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="0.5" horizontal="NO" id="HTa-Cj-3VH">
-                                                            <rect key="frame" x="-100" y="-100" width="16" height="53"/>
-                                                            <autoresizingMask key="autoresizingMask"/>
-                                                        </scroller>
-                                                    </scrollView>
                                                     <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="DB4-cs-hpp">
                                                         <rect key="frame" x="348" y="16" width="54" height="19"/>
                                                         <constraints>
@@ -172,33 +133,26 @@
                                                     </button>
                                                 </subviews>
                                                 <constraints>
-                                                    <constraint firstItem="I1j-wy-Idd" firstAttribute="leading" secondItem="z8C-93-gRy" secondAttribute="trailing" constant="5" id="1Rj-xl-bWd"/>
-                                                    <constraint firstItem="Vgg-xb-RNp" firstAttribute="leading" secondItem="8H3-LL-pKv" secondAttribute="trailing" constant="60" id="3Se-u0-IiQ"/>
-                                                    <constraint firstItem="GFf-Vw-dow" firstAttribute="top" secondItem="izN-no-Boc" secondAttribute="bottom" constant="10" id="5AQ-UQ-jtC"/>
-                                                    <constraint firstItem="I1j-wy-Idd" firstAttribute="centerY" secondItem="z8C-93-gRy" secondAttribute="centerY" id="6Zw-yt-i92"/>
                                                     <constraint firstAttribute="trailing" secondItem="lwB-Po-Omx" secondAttribute="trailing" constant="3" id="7n8-ob-aJe"/>
                                                     <constraint firstAttribute="trailing" secondItem="DB4-cs-hpp" secondAttribute="trailing" constant="10" id="D0W-VU-ZXm"/>
                                                     <constraint firstItem="lwB-Po-Omx" firstAttribute="top" secondItem="DB4-cs-hpp" secondAttribute="bottom" constant="5" id="Iaq-Eq-7PP"/>
                                                     <constraint firstItem="DB4-cs-hpp" firstAttribute="centerY" secondItem="GFf-Vw-dow" secondAttribute="centerY" id="InQ-LZ-GMi"/>
+                                                    <constraint firstAttribute="trailing" secondItem="z8C-93-gRy" secondAttribute="trailing" constant="10" id="JOz-9t-6V5"/>
                                                     <constraint firstItem="GFf-Vw-dow" firstAttribute="centerY" secondItem="pzN-en-gvs" secondAttribute="centerY" id="Q5R-xc-wqV"/>
-                                                    <constraint firstItem="pzN-en-gvs" firstAttribute="top" secondItem="izN-no-Boc" secondAttribute="bottom" constant="10" id="WYf-Cw-5VK"/>
+                                                    <constraint firstItem="I1j-wy-Idd" firstAttribute="top" secondItem="z8C-93-gRy" secondAttribute="bottom" constant="5" id="Vry-5X-w7C"/>
                                                     <constraint firstAttribute="bottom" secondItem="lwB-Po-Omx" secondAttribute="bottom" constant="11" id="bP0-ac-SO8"/>
                                                     <constraint firstItem="GFf-Vw-dow" firstAttribute="leading" secondItem="pzN-en-gvs" secondAttribute="trailing" constant="15" id="dZn-a1-XaA"/>
-                                                    <constraint firstAttribute="trailing" secondItem="Vgg-xb-RNp" secondAttribute="trailing" constant="10" id="ePY-CE-umQ"/>
                                                     <constraint firstItem="8H3-LL-pKv" firstAttribute="leading" secondItem="auA-QD-eI4" secondAttribute="leading" constant="3" id="gct-ct-rbb"/>
                                                     <constraint firstItem="z8C-93-gRy" firstAttribute="leading" secondItem="8H3-LL-pKv" secondAttribute="trailing" constant="2" id="gzR-7T-UyB"/>
+                                                    <constraint firstItem="I1j-wy-Idd" firstAttribute="leading" secondItem="z8C-93-gRy" secondAttribute="leading" id="k67-uz-PKy"/>
                                                     <constraint firstItem="DB4-cs-hpp" firstAttribute="leading" secondItem="GFf-Vw-dow" secondAttribute="trailing" constant="15" id="m7B-Ip-1hz"/>
                                                     <constraint firstItem="lwB-Po-Omx" firstAttribute="leading" secondItem="auA-QD-eI4" secondAttribute="leading" constant="14" id="mBJ-fJ-sDu"/>
-                                                    <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="I1j-wy-Idd" secondAttribute="trailing" constant="10" id="pF8-GH-hD9"/>
+                                                    <constraint firstAttribute="trailing" secondItem="I1j-wy-Idd" secondAttribute="trailing" constant="10" id="pF8-GH-hD9"/>
                                                     <constraint firstItem="z8C-93-gRy" firstAttribute="top" secondItem="auA-QD-eI4" secondAttribute="top" constant="10" id="qBN-Wl-ybY"/>
-                                                    <constraint firstItem="DB4-cs-hpp" firstAttribute="top" secondItem="izN-no-Boc" secondAttribute="bottom" constant="10" id="qoj-5F-FoK"/>
                                                     <constraint firstItem="lwB-Po-Omx" firstAttribute="top" secondItem="GFf-Vw-dow" secondAttribute="bottom" constant="5" id="ssY-Uh-O4o"/>
                                                     <constraint firstItem="lwB-Po-Omx" firstAttribute="top" secondItem="pzN-en-gvs" secondAttribute="bottom" constant="5" id="uEt-xH-Gis"/>
                                                     <constraint firstItem="8H3-LL-pKv" firstAttribute="top" secondItem="auA-QD-eI4" secondAttribute="top" constant="7" id="umv-u5-XYK"/>
                                                 </constraints>
-                                                <connections>
-                                                    <outlet property="msgView" destination="izN-no-Boc" id="Sx2-rs-lSp"/>
-                                                </connections>
                                             </tableCellView>
                                         </prototypeCellViews>
                                     </tableColumn>