Work around a WeeChat protocol inconvenience
Until WeeChat sends a confirmation for init we have to assume that the commands will be received synchronously even though they are sent asynchronously
This commit is contained in:
parent
ba20a79c72
commit
27690ada58
|
@ -272,16 +272,23 @@ function($rootScope,
|
||||||
|
|
||||||
// Helper methods for initialization commands
|
// Helper methods for initialization commands
|
||||||
var _initializeConnection = function(passwd) {
|
var _initializeConnection = function(passwd) {
|
||||||
return ngWebsockets.sendAll([
|
|
||||||
|
// This is not the proper way to do this.
|
||||||
|
// WeeChat does not send a confirmation for the init.
|
||||||
|
// Until it does, We need to "assume" that formatInit
|
||||||
|
// will be received before formatInfo
|
||||||
|
ngWebsockets.send(
|
||||||
weeChat.Protocol.formatInit({
|
weeChat.Protocol.formatInit({
|
||||||
password: passwd,
|
password: passwd,
|
||||||
compression: noCompression ? 'off' : 'zlib'
|
compression: noCompression ? 'off' : 'zlib'
|
||||||
}),
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
return ngWebsockets.send(
|
||||||
weeChat.Protocol.formatInfo({
|
weeChat.Protocol.formatInfo({
|
||||||
name: 'version'
|
name: 'version'
|
||||||
})
|
})
|
||||||
])
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
var _requestHotlist = function() {
|
var _requestHotlist = function() {
|
||||||
|
|
Loading…
Reference in New Issue