Only use 0 to compare boolean values.
This commit is contained in:
parent
a5843ae71b
commit
506d5d29d9
1 changed files with 9 additions and 9 deletions
|
@ -549,8 +549,8 @@ Umi.Protocol.SockChat.Protocol = function(views) {
|
|||
sound = 'incoming';
|
||||
const muser = Umi.Users.Get(data[2]) || chatBot,
|
||||
textParts = text.split("\f");
|
||||
isPM = data[5][4] === '1',
|
||||
isAction = data[5][1] === '1' && data[5][3] === '0',
|
||||
isPM = data[5][4] !== '0',
|
||||
isAction = data[5][1] !== '0' && data[5][3] === '0',
|
||||
isBot = data[2] === '-1',
|
||||
pmChannel = '@' + muser.getName(),
|
||||
botInfo = {};
|
||||
|
@ -669,14 +669,14 @@ Umi.Protocol.SockChat.Protocol = function(views) {
|
|||
case '4': // channel
|
||||
switch(data[1]) {
|
||||
case '0':
|
||||
Umi.Channels.Add(new Umi.Channel(data[2], data[3] === '1', data[4] === '1'));
|
||||
Umi.Channels.Add(new Umi.Channel(data[2], data[3] !== '0', data[4] !== '0'));
|
||||
break;
|
||||
|
||||
case '1':
|
||||
const uchannel = Umi.Channels.Get(data[2]);
|
||||
uchannel.setName(data[3]);
|
||||
uchannel.setHasPassword(data[4] === '1');
|
||||
uchannel.setTemporary(data[5] === '1');
|
||||
uchannel.setHasPassword(data[4] !== '0');
|
||||
uchannel.setTemporary(data[5] !== '0');
|
||||
Umi.Channels.Update(data[2], uchannel);
|
||||
break;
|
||||
|
||||
|
@ -790,7 +790,7 @@ Umi.Protocol.SockChat.Protocol = function(views) {
|
|||
channelName,
|
||||
false,
|
||||
cmbotInfo,
|
||||
cmflags[1] === '1' && cmflags[3] === '0',
|
||||
cmflags[1] !== '0' && cmflags[3] === '0',
|
||||
));
|
||||
break;
|
||||
|
||||
|
@ -801,8 +801,8 @@ Umi.Protocol.SockChat.Protocol = function(views) {
|
|||
for(let i = 0; i < ecpamount; i++) {
|
||||
const channel = new Umi.Channel(
|
||||
data[ecpstart],
|
||||
data[ecpstart + 1] === '1',
|
||||
data[ecpstart + 2] === '1'
|
||||
data[ecpstart + 1] !== '0',
|
||||
data[ecpstart + 2] !== '0'
|
||||
);
|
||||
Umi.Channels.Add(channel);
|
||||
|
||||
|
@ -851,7 +851,7 @@ Umi.Protocol.SockChat.Protocol = function(views) {
|
|||
noReconnect = true;
|
||||
wasKicked = true;
|
||||
|
||||
const isBan = data[1] === '1';
|
||||
const isBan = data[1] !== '0';
|
||||
|
||||
let message = 'You were kicked, refresh to log back in!';
|
||||
if(isBan) {
|
||||
|
|
Loading…
Reference in a new issue