Commit 6c6aa85b authored by Evert Prants's avatar Evert Prants

remove trailing x01 from action, fix topic set time

parent 394eb42f
......@@ -76,7 +76,6 @@ async function _waitOpen (s) {
try {
await new Promise((resolve, reject) => {
o = function () {
console.log('removing events', o, c)
s.removeEventListener('close', c)
s.removeEventListener('open', o)
resolve()
......@@ -105,11 +104,9 @@ async function _trySocket (address, port, ssl, useTranslator) {
}
let tSock = new WebSocket(proto + '://' + conn)
try {
console.log('Waiting to open')
await _waitOpen(tSock)
} catch (e) {
console.error(e)
console.error('Waiting to open failed')
return _trySocket(address, port, ssl, true)
}
......@@ -482,7 +479,7 @@ class IRCConnectionHandler {
break
case '333':
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
case '375':
......@@ -758,7 +755,6 @@ class IRCConnection extends EventEmitter {
this.socket.addEventListener('message', (e) => {
let line = e.data
if (line.indexOf('PING') === 0) {
console.log('%s server pinged us (%s)', new Date(), line)
this.write('PONG %s', line.substring(4))
return
}
......
......@@ -1998,6 +1998,7 @@ class IRCChatWindow {
if (message.type === 'privmsg' && message.message.indexOf('\x01ACTION') === 0) {
message.message = message.message.substring(8)
message.message = message.message.substring(0, message.message.length - 1)
message.type = 'action'
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment