loleaflet/src/core/Socket.js |   18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)

New commits:
commit 21d707757fc8964bc66a64cba206680a4162c7cb
Author:     Tor Lillqvist <t...@collabora.com>
AuthorDate: Thu Mar 14 20:18:14 2019 +0200
Commit:     Tor Lillqvist <t...@collabora.com>
CommitDate: Thu Mar 14 20:47:08 2019 +0200

    Make the iOS app work again
    
    We already do all the FakeWebSocket setup things in global.js. We
    don't need to do it again in the connect() function in Socket.js (and
    doing so in fact breaks stuff).
    
    Change-Id: I2b77b85f2659995e99d21339685717fba14db371

diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js
index 84fa0f304..1428aa7a5 100644
--- a/loleaflet/src/core/Socket.js
+++ b/loleaflet/src/core/Socket.js
@@ -31,11 +31,10 @@ L.Socket = L.Class.extend({
                if (this.socket) {
                        this.close();
                }
-               if (window.ThisIsAMobileApp) {
-                       this.socket = new window.FakeWebSocket();
-                       window.TheFakeWebSocket = this.socket;
-               } else if (socket && (socket.readyState === 1 || 
socket.readyState === 0)) {
+               if (socket && (socket.readyState === 1 || socket.readyState === 
0)) {
                        this.socket = socket;
+               } else if (window.ThisIsAMobileApp) {
+                       // We have already opened the FakeWebSocket over in 
global.js
                } else  {
                        var wopiSrc = '';
                        if (map.options.wopiSrc != '') {
@@ -63,17 +62,6 @@ L.Socket = L.Class.extend({
                this.socket.onopen = L.bind(this._onSocketOpen, this);
                this.socket.onmessage = L.bind(this._onMessage, this);
                this.socket.binaryType = 'arraybuffer';
-               if (window.ThisIsAMobileApp) {
-                       // This corresponds to the initial GET request when 
creating a WebSocket
-                       // connection and tells the app's code that it is OK to 
start invoking
-                       // TheFakeWebSocket's onmessage handler. Should we also 
include the
-                       // map.options.doc, as in the websocketURI above? On 
the other hand, the app
-                       // code that handles this special message knows the 
document to be edited
-                       // anyway, and can send it on as necessary to the 
Online code.
-                       window.postMobileMessage('HULLO');
-                       // A FakeWebSocket is immediately open.
-                       this.socket.onopen();
-               }
                if (map.options.docParams.access_token && 
parseInt(map.options.docParams.access_token_ttl)) {
                        var tokenExpiryWarning = 900 * 1000; // Warn when 15 
minutes remain
                        clearTimeout(this._accessTokenExpireTimeout);
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to