@ -212,16 +212,14 @@ angular.module('myApp.directives', ['myApp.filters'])
}
}
function updateMessageSignature ( $scope , element , message ) {
function updateMessageSignature ( $scope , element , message ) {
if ( ! message . signID ) {
var postAuthor = message . post _author || ( message . fwd _from && message . fwd _from . post _author )
if ( ! postAuthor ) {
$ ( '.im_message_sign' , element ) . hide ( )
$ ( '.im_message_sign' , element ) . hide ( )
return
return
}
}
var scope = $scope . $new ( true )
var html = RichTextProcessor . wrapRichText ( postAuthor , { noLinks : true , noLinebreaks : true } )
scope . signID = message . signID
$ ( '.im_message_sign' , element ) . html ( '<span class="im_message_sign_link">' + html . valueOf ( ) + '</span>' )
messageSignCompiled ( scope , function ( clonedElement ) {
$ ( '.im_message_sign' , element ) . replaceWith ( clonedElement )
} )
}
}
function updateMessageKeyboard ( $scope , element , message ) {
function updateMessageKeyboard ( $scope , element , message ) {
@ -3004,7 +3002,7 @@ angular.module('myApp.directives', ['myApp.filters'])
participantsCount = chat . participants _count
participantsCount = chat . participants _count
}
}
update ( )
update ( )
if ( ! chatID ) {
if ( ! chatID || AppChatsManager . isChannel ( chatID ) && participantsCount ) {
return
return
}
}
AppProfileManager . getChatFull ( chatID ) . then ( function ( chatFull ) {
AppProfileManager . getChatFull ( chatID ) . then ( function ( chatFull ) {
@ -3104,7 +3102,7 @@ angular.module('myApp.directives', ['myApp.filters'])
}
}
} )
} )
. directive ( 'myPeerLink' , function ( AppChatsManager , AppUsersManager ) {
. directive ( 'myPeerLink' , function ( $rootScope , AppChatsManager , AppUsersManager , AppMessagesID sManager ) {
return {
return {
link : link
link : link
}
}
@ -3147,7 +3145,16 @@ angular.module('myApp.directives', ['myApp.filters'])
if ( peerID > 0 ) {
if ( peerID > 0 ) {
AppUsersManager . openUser ( peerID , override )
AppUsersManager . openUser ( peerID , override )
} else {
} else {
AppChatsManager . openChat ( - peerID )
var chatID = - peerID
var postID = $scope . $eval ( attrs . postId )
if ( postID ) {
$rootScope . $broadcast ( 'history_focus' , {
peerString : AppChatsManager . getChatString ( chatID ) ,
messageID : AppMessagesIDsManager . getFullMessageID ( parseInt ( postID ) , chatID )
} )
} else {
AppChatsManager . openChat ( chatID )
}
}
}
} )
} )
}
}