Revert "Use protocol buffer module for `libtextsecure`"
This does not work with `ArrayBuffer` out of the box and will need to be investigated and tested more before switching. Some APIs also seemed to have changed: - Before (OOP): `new textsecure.protobuf.WebSocketMessage(…).encode();` - After (functional): ``` textsecure.protobuf.WebSocketMessage.encode( new textsecure.protobuf.WebSocketMessage(…) ); ``` This reverts commit d758119d9de4f99742ea941e86180b1d600c2f22.pull/1/head
parent
60077d0b7b
commit
ba4d8952c6
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,42 @@
|
|||||||
|
(function() {
|
||||||
|
'use strict';
|
||||||
|
window.textsecure = window.textsecure || {};
|
||||||
|
window.textsecure.protobuf = {};
|
||||||
|
|
||||||
|
function loadProtoBufs(filename) {
|
||||||
|
return dcodeIO.ProtoBuf.loadProtoFile(
|
||||||
|
{ root: window.PROTO_ROOT, file: filename },
|
||||||
|
function(error, result) {
|
||||||
|
if (error) {
|
||||||
|
var text =
|
||||||
|
'Error loading protos from ' +
|
||||||
|
filename +
|
||||||
|
' (root: ' +
|
||||||
|
window.PROTO_ROOT +
|
||||||
|
') ' +
|
||||||
|
(error && error.stack ? error.stack : error);
|
||||||
|
console.log(text);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
var protos = result.build('signalservice');
|
||||||
|
if (!protos) {
|
||||||
|
var text =
|
||||||
|
'Error loading protos from ' +
|
||||||
|
filename +
|
||||||
|
' (root: ' +
|
||||||
|
window.PROTO_ROOT +
|
||||||
|
')';
|
||||||
|
console.log(text);
|
||||||
|
throw new Error(text);
|
||||||
|
}
|
||||||
|
for (var protoName in protos) {
|
||||||
|
textsecure.protobuf[protoName] = protos[protoName];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
loadProtoBufs('SignalService.proto');
|
||||||
|
loadProtoBufs('SubProtocol.proto');
|
||||||
|
loadProtoBufs('DeviceMessages.proto');
|
||||||
|
})();
|
Loading…
Reference in New Issue