Fixed share

This commit is contained in:
Igor Zhukov 2015-10-13 17:33:17 +02:00
parent 398a0e2220
commit a208dca350
2 changed files with 3 additions and 4 deletions

View File

@ -2186,7 +2186,6 @@ angular.module('myApp.controllers', ['myApp.i18n'])
} }
function applyShare (e, shareData) { function applyShare (e, shareData) {
console.log('apply share', shareData);
var url = shareData.url; var url = shareData.url;
var text = shareData.text || ''; var text = shareData.text || '';
@ -2199,7 +2198,7 @@ angular.module('myApp.controllers', ['myApp.i18n'])
'' ''
] ]
}); });
}, 100); }, 1000);
} }
function replySelect(messageID) { function replySelect(messageID) {

View File

@ -3739,12 +3739,12 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
return true; return true;
} }
if (matches = url.match(/^msg_url\?url=(.+)(?:&text=(.*))?$/)) { if (matches = url.match(/^msg_url\?url=([^&]+)(?:&text=(.*))?$/)) {
PeersSelectService.selectPeer({ PeersSelectService.selectPeer({
confirm_type: 'SHARE_URL' confirm_type: 'SHARE_URL'
}).then(function (toPeerString) { }).then(function (toPeerString) {
var url = decodeURIComponent(matches[1]); var url = decodeURIComponent(matches[1]);
var text = matches[3] ? decodeURIComponent(matches[3]) : ''; var text = matches[2] ? decodeURIComponent(matches[2]) : '';
$rootScope.$broadcast('history_focus', {peerString: toPeerString, shareUrl: url, shareText: text}); $rootScope.$broadcast('history_focus', {peerString: toPeerString, shareUrl: url, shareText: text});
}); });
return true; return true;