Fixed shared contact attachment
This commit is contained in:
parent
6549bd7e17
commit
0b79453405
@ -1144,6 +1144,10 @@ a.im_message_contact_photo {
|
|||||||
.im_message_contact_name {
|
.im_message_contact_name {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
.im_message_contact_name,
|
||||||
|
.im_message_contact_phone {
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
a.im_message_photo_thumb,
|
a.im_message_photo_thumb,
|
||||||
a.im_message_video_thumb {
|
a.im_message_video_thumb {
|
||||||
display: block;
|
display: block;
|
||||||
|
@ -387,6 +387,16 @@ html {
|
|||||||
width: auto;
|
width: auto;
|
||||||
max-width: 250px;
|
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 {
|
.im_message_document {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
@ -1886,10 +1886,12 @@ angular.module('myApp.controllers', ['myApp.i18n'])
|
|||||||
MtpApiManager.invokeApi('users.getFullUser', {
|
MtpApiManager.invokeApi('users.getFullUser', {
|
||||||
id: AppUsersManager.getUserInput($scope.userID)
|
id: AppUsersManager.getUserInput($scope.userID)
|
||||||
}).then(function (userFullResult) {
|
}).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.phone = $scope.override.phone_number;
|
||||||
userFullResult.user.first_name = $scope.override.first_name;
|
if ($scope.override.first_name || $scope.override.last_name) {
|
||||||
userFullResult.user.last_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);
|
AppUsersManager.saveApiUser(userFullResult.user);
|
||||||
} else {
|
} else {
|
||||||
AppUsersManager.saveApiUser(userFullResult.user, true);
|
AppUsersManager.saveApiUser(userFullResult.user, true);
|
||||||
|
@ -2023,12 +2023,16 @@ angular.module('myApp.directives', ['myApp.filters'])
|
|||||||
|
|
||||||
function link($scope, element, attrs) {
|
function link($scope, element, attrs) {
|
||||||
|
|
||||||
|
var override = attrs.userOverride && $scope.$eval(attrs.userOverride) || {};
|
||||||
|
var short = attrs.short && $scope.$eval(attrs.short);
|
||||||
|
|
||||||
var userID;
|
var userID;
|
||||||
var update = function () {
|
var update = function () {
|
||||||
var user = AppUsersManager.getUser(userID);
|
var user = AppUsersManager.getUser(userID);
|
||||||
|
var key = short ? 'rFirstName' : 'rFullName';
|
||||||
|
|
||||||
element.html(
|
element.html(
|
||||||
(user[attrs.short && $scope.$eval(attrs.short) ? 'rFirstName' : 'rFullName'] || '').valueOf()
|
(override[key] || user[key] || '').valueOf()
|
||||||
);
|
);
|
||||||
if (attrs.color && $scope.$eval(attrs.color)) {
|
if (attrs.color && $scope.$eval(attrs.color)) {
|
||||||
element.addClass('user_color_' + user.num);
|
element.addClass('user_color_' + user.num);
|
||||||
@ -2037,7 +2041,7 @@ angular.module('myApp.directives', ['myApp.filters'])
|
|||||||
|
|
||||||
if (element[0].tagName == 'A') {
|
if (element[0].tagName == 'A') {
|
||||||
element.on('click', function () {
|
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 {
|
return {
|
||||||
link: link,
|
link: link,
|
||||||
scope: {
|
|
||||||
userID: '=myUserPhotolink'
|
|
||||||
},
|
|
||||||
template: '<img my-load-thumb thumb="photo" /><i class="icon icon-online" ng-if="::showStatus || false" ng-show="user.status._ == \'userStatusOnline\'"></i>'
|
template: '<img my-load-thumb thumb="photo" /><i class="icon icon-online" ng-if="::showStatus || false" ng-show="user.status._ == \'userStatusOnline\'"></i>'
|
||||||
};
|
};
|
||||||
|
|
||||||
function link($scope, element, attrs) {
|
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)) {
|
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') {
|
if (element[0].tagName == 'A') {
|
||||||
element.on('click', function (e) {
|
element.on('click', function (e) {
|
||||||
AppUsersManager.openUser($scope.userID, attrs.userOverride && $scope.$eval(attrs.userOverride));
|
AppUsersManager.openUser(userID, attrs.userOverride && $scope.$eval(attrs.userOverride));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@
|
|||||||
<div ng-switch-when="messageMediaDocument" my-message-document="historyMessage.media.document" message-id="historyMessage.id"></div>
|
<div ng-switch-when="messageMediaDocument" my-message-document="historyMessage.media.document" message-id="historyMessage.id"></div>
|
||||||
<div ng-switch-when="messageMediaAudio" class="im_message_audio" my-audio-player audio="historyMessage.media.audio"></div>
|
<div ng-switch-when="messageMediaAudio" class="im_message_audio" my-audio-player audio="historyMessage.media.audio"></div>
|
||||||
<div ng-switch-when="messageMediaGeo" my-message-map></div>
|
<div ng-switch-when="messageMediaGeo" my-message-map></div>
|
||||||
<div ng-switch-when="messageMediaContact" my-message-contact></div>
|
<div ng-switch-when="messageMediaContact" class="im_message_contact" my-message-contact></div>
|
||||||
<div ng-switch-when="messageMediaPending" my-message-pending></div>
|
<div ng-switch-when="messageMediaPending" my-message-pending></div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
<div ng-switch-when="messageMediaDocument" my-message-document="historyMessage.media.document" message-id="historyMessage.id"></div>
|
<div ng-switch-when="messageMediaDocument" my-message-document="historyMessage.media.document" message-id="historyMessage.id"></div>
|
||||||
<div ng-switch-when="messageMediaAudio" class="im_message_audio" my-audio-player audio="historyMessage.media.audio"></div>
|
<div ng-switch-when="messageMediaAudio" class="im_message_audio" my-audio-player audio="historyMessage.media.audio"></div>
|
||||||
<div ng-switch-when="messageMediaGeo" my-message-map></div>
|
<div ng-switch-when="messageMediaGeo" my-message-map></div>
|
||||||
<div ng-switch-when="messageMediaContact" my-message-contact></div>
|
<div ng-switch-when="messageMediaContact" class="im_message_contact" my-message-contact></div>
|
||||||
<div ng-switch-when="messageMediaPending" my-message-pending></div>
|
<div ng-switch-when="messageMediaPending" my-message-pending></div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user