remove trailing x01 from action, fix topic set time
This commit is contained in:
parent
394eb42fbc
commit
6c6aa85bf4
@ -76,7 +76,6 @@ async function _waitOpen (s) {
|
|||||||
try {
|
try {
|
||||||
await new Promise((resolve, reject) => {
|
await new Promise((resolve, reject) => {
|
||||||
o = function () {
|
o = function () {
|
||||||
console.log('removing events', o, c)
|
|
||||||
s.removeEventListener('close', c)
|
s.removeEventListener('close', c)
|
||||||
s.removeEventListener('open', o)
|
s.removeEventListener('open', o)
|
||||||
resolve()
|
resolve()
|
||||||
@ -105,11 +104,9 @@ async function _trySocket (address, port, ssl, useTranslator) {
|
|||||||
}
|
}
|
||||||
let tSock = new WebSocket(proto + '://' + conn)
|
let tSock = new WebSocket(proto + '://' + conn)
|
||||||
try {
|
try {
|
||||||
console.log('Waiting to open')
|
|
||||||
await _waitOpen(tSock)
|
await _waitOpen(tSock)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e)
|
console.error(e)
|
||||||
console.error('Waiting to open failed')
|
|
||||||
return _trySocket(address, port, ssl, true)
|
return _trySocket(address, port, ssl, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -482,7 +479,7 @@ class IRCConnectionHandler {
|
|||||||
break
|
break
|
||||||
case '333':
|
case '333':
|
||||||
this.conn.emit('pass_to_client', {
|
this.conn.emit('pass_to_client', {
|
||||||
type: 'channel_topic', channel: line.arguments[1], set_by: line.arguments[2], time: line.arguments[3], server: serverName
|
type: 'channel_topic', channel: line.arguments[1], set_by: line.arguments[2], time: (line.arguments[3] || line.trailing), server: serverName
|
||||||
})
|
})
|
||||||
break
|
break
|
||||||
case '375':
|
case '375':
|
||||||
@ -758,7 +755,6 @@ class IRCConnection extends EventEmitter {
|
|||||||
this.socket.addEventListener('message', (e) => {
|
this.socket.addEventListener('message', (e) => {
|
||||||
let line = e.data
|
let line = e.data
|
||||||
if (line.indexOf('PING') === 0) {
|
if (line.indexOf('PING') === 0) {
|
||||||
console.log('%s server pinged us (%s)', new Date(), line)
|
|
||||||
this.write('PONG %s', line.substring(4))
|
this.write('PONG %s', line.substring(4))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -1998,6 +1998,7 @@ class IRCChatWindow {
|
|||||||
|
|
||||||
if (message.type === 'privmsg' && message.message.indexOf('\x01ACTION') === 0) {
|
if (message.type === 'privmsg' && message.message.indexOf('\x01ACTION') === 0) {
|
||||||
message.message = message.message.substring(8)
|
message.message = message.message.substring(8)
|
||||||
|
message.message = message.message.substring(0, message.message.length - 1)
|
||||||
message.type = 'action'
|
message.type = 'action'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user