diff --git a/app/css/app.css b/app/css/app.css index 214fd925..17a0e25d 100644 --- a/app/css/app.css +++ b/app/css/app.css @@ -1144,6 +1144,10 @@ a.im_message_contact_photo { .im_message_contact_name { font-weight: bold; } +.im_message_contact_name, +.im_message_contact_phone { + white-space: nowrap; +} a.im_message_photo_thumb, a.im_message_video_thumb { display: block; diff --git a/app/css/mobile.css b/app/css/mobile.css index 0d83f0c5..4ed15ea4 100644 --- a/app/css/mobile.css +++ b/app/css/mobile.css @@ -387,6 +387,16 @@ html { width: auto; max-width: 250px; } +.im_message_contact { + width: 200px; +} +.im_message_contact_name, +.im_message_contact_phone { + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + max-width: 150px; +} .im_message_document { position: relative; } diff --git a/app/js/controllers.js b/app/js/controllers.js index cf82296e..b63bbff1 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -1886,10 +1886,12 @@ angular.module('myApp.controllers', ['myApp.i18n']) MtpApiManager.invokeApi('users.getFullUser', { id: AppUsersManager.getUserInput($scope.userID) }).then(function (userFullResult) { - if ($scope.override && $scope.override.phone_number && !userFullResult.user.phone) { + if ($scope.override && $scope.override.phone_number) { userFullResult.user.phone = $scope.override.phone_number; - userFullResult.user.first_name = $scope.override.first_name; - userFullResult.user.last_name = $scope.override.last_name; + if ($scope.override.first_name || $scope.override.last_name) { + userFullResult.user.first_name = $scope.override.first_name; + userFullResult.user.last_name = $scope.override.last_name; + } AppUsersManager.saveApiUser(userFullResult.user); } else { AppUsersManager.saveApiUser(userFullResult.user, true); diff --git a/app/js/directives.js b/app/js/directives.js index d3ce71c6..5cf1db92 100644 --- a/app/js/directives.js +++ b/app/js/directives.js @@ -2023,12 +2023,16 @@ angular.module('myApp.directives', ['myApp.filters']) function link($scope, element, attrs) { + var override = attrs.userOverride && $scope.$eval(attrs.userOverride) || {}; + var short = attrs.short && $scope.$eval(attrs.short); + var userID; var update = function () { var user = AppUsersManager.getUser(userID); + var key = short ? 'rFirstName' : 'rFullName'; element.html( - (user[attrs.short && $scope.$eval(attrs.short) ? 'rFirstName' : 'rFullName'] || '').valueOf() + (override[key] || user[key] || '').valueOf() ); if (attrs.color && $scope.$eval(attrs.color)) { element.addClass('user_color_' + user.num); @@ -2037,7 +2041,7 @@ angular.module('myApp.directives', ['myApp.filters']) if (element[0].tagName == 'A') { element.on('click', function () { - AppUsersManager.openUser(userID, attrs.userOverride && $scope.$eval(attrs.userOverride)); + AppUsersManager.openUser(userID, override); }); } @@ -2102,22 +2106,22 @@ angular.module('myApp.directives', ['myApp.filters']) return { link: link, - scope: { - userID: '=myUserPhotolink' - }, template: '' }; function link($scope, element, attrs) { - $scope.photo = AppUsersManager.getUserPhoto($scope.userID, 'User'); + + var userID = $scope.$eval(attrs.myUserPhotolink); + + $scope.photo = AppUsersManager.getUserPhoto(userID, 'User'); if ($scope.showStatus = attrs.status && $scope.$eval(attrs.status)) { - $scope.user = AppUsersManager.getUser($scope.userID); + $scope.user = AppUsersManager.getUser(userID); } if (element[0].tagName == 'A') { element.on('click', function (e) { - AppUsersManager.openUser($scope.userID, attrs.userOverride && $scope.$eval(attrs.userOverride)); + AppUsersManager.openUser(userID, attrs.userOverride && $scope.$eval(attrs.userOverride)); }); } diff --git a/app/partials/desktop/message.html b/app/partials/desktop/message.html index 15c33c49..6966e02d 100644 --- a/app/partials/desktop/message.html +++ b/app/partials/desktop/message.html @@ -55,7 +55,7 @@
-
+
diff --git a/app/partials/mobile/message.html b/app/partials/mobile/message.html index 60ff3c7d..c6defe31 100644 --- a/app/partials/mobile/message.html +++ b/app/partials/mobile/message.html @@ -45,7 +45,7 @@
-
+