parent
be06ca6520
commit
925e48f04a
@ -719,7 +719,7 @@ angular.module('myApp.services', [])
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
.service('AppMessagesManager', function ($q, $rootScope, $location, $filter, ApiUpdatesManager, AppUsersManager, AppChatsManager, AppPeersManager, AppPhotosManager, AppVideoManager, AppDocsManager, AppAudioManager, MtpApiManager, MtpApiFileManager, RichTextProcessor, NotificationsManager, SearchIndexManager, Storage) {
|
.service('AppMessagesManager', function ($q, $rootScope, $location, $filter, ApiUpdatesManager, AppUsersManager, AppChatsManager, AppPeersManager, AppPhotosManager, AppVideoManager, AppDocsManager, AppAudioManager, MtpApiManager, MtpApiFileManager, RichTextProcessor, NotificationsManager, SearchIndexManager, PeersSelectService, Storage) {
|
||||||
|
|
||||||
var messagesStorage = {};
|
var messagesStorage = {};
|
||||||
var messagesForHistory = {};
|
var messagesForHistory = {};
|
||||||
@ -1961,6 +1961,23 @@ angular.module('myApp.services', [])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (window.navigator.mozSetMessageHandler) {
|
||||||
|
window.navigator.mozSetMessageHandler('activity', function(activityRequest) {
|
||||||
|
var source = activityRequest.source;
|
||||||
|
console.log(dT(), 'Received activity', source.name, source.data);
|
||||||
|
|
||||||
|
if (source.name === 'share' && source.data.blobs.length > 0) {
|
||||||
|
PeersSelectService.selectPeer({confirm_type: 'EXT_SHARE_PEER'}).then(function (peerString) {
|
||||||
|
var peerID = AppPeersManager.getPeerID(peerString);
|
||||||
|
angular.forEach(source.data.blobs, function (blob) {
|
||||||
|
sendFile(peerID, blob, {isMedia: true});
|
||||||
|
});
|
||||||
|
$rootScope.$broadcast('history_focus', {peerString: peerString});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
$rootScope.$on('apiUpdate', function (e, update) {
|
$rootScope.$on('apiUpdate', function (e, update) {
|
||||||
// if (update._ != 'updateUserStatus') {
|
// if (update._ != 'updateUserStatus') {
|
||||||
// console.log('on apiUpdate', update);
|
// console.log('on apiUpdate', update);
|
||||||
|
@ -30,6 +30,14 @@
|
|||||||
"description": "Required for notifications"
|
"description": "Required for notifications"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"activities": {
|
||||||
|
"share": {
|
||||||
|
"href": "/index.html",
|
||||||
|
"disposition": "window",
|
||||||
|
"filters": {},
|
||||||
|
"returnValue": false
|
||||||
|
}
|
||||||
|
},
|
||||||
"orientation": "portrait-primary",
|
"orientation": "portrait-primary",
|
||||||
"icons": {
|
"icons": {
|
||||||
"16": "/img/icons/icon16.png",
|
"16": "/img/icons/icon16.png",
|
||||||
|
@ -34,6 +34,10 @@
|
|||||||
<span ng-switch-when="true" ng-bind-html="peer_data.rFullName"></span>
|
<span ng-switch-when="true" ng-bind-html="peer_data.rFullName"></span>
|
||||||
<span ng-switch-default ng-bind-html="peer_data.rTitle"></span>
|
<span ng-switch-default ng-bind-html="peer_data.rTitle"></span>
|
||||||
</strong>?</span>
|
</strong>?</span>
|
||||||
|
<span ng-switch-when="EXT_SHARE_PEER">Share with <strong ng-switch="peer_id > 0">
|
||||||
|
<span ng-switch-when="true" ng-bind-html="peer_data.rFullName"></span>
|
||||||
|
<span ng-switch-default ng-bind-html="peer_data.rTitle"></span>
|
||||||
|
</strong>?</span>
|
||||||
<span ng-switch-default ng-bind="message || 'Are you sure?'"></span>
|
<span ng-switch-default ng-bind="message || 'Are you sure?'"></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -53,6 +57,7 @@
|
|||||||
<span ng-switch-when="PHOTO_SHARE_PEER">Forward photo</span>
|
<span ng-switch-when="PHOTO_SHARE_PEER">Forward photo</span>
|
||||||
<span ng-switch-when="VIDEO_SHARE_PEER">Forward video</span>
|
<span ng-switch-when="VIDEO_SHARE_PEER">Forward video</span>
|
||||||
<span ng-switch-when="SHARE_CONTACT_PEER">Send contact</span>
|
<span ng-switch-when="SHARE_CONTACT_PEER">Send contact</span>
|
||||||
|
<span ng-switch-when="EXT_SHARE_PEER">Share file</span>
|
||||||
<span ng-switch-default>OK</span>
|
<span ng-switch-default>OK</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user