kiwiirc / irc-framework

🛠️ A better IRC framework for node.js. For bots and full clients.
MIT License
181 stars 63 forks source link

RPL_ISUPPORT: fix handling of empty string in PREFIX #284

Closed brunnre8 closed 3 years ago

brunnre8 commented 3 years ago

Callers expect an array even if the string is empty, give them that.

Happened in thelounge when connecting to psyced.org... they return the following data:

{
    options: {
    CASEMAPPING: 'ascii',
    PREFIX: '',
    PSYC: '.99',
    ALIAS: true,
    AVAILABILITY: true,
    FRIEND: true,
    HISTORY: true,
    MOOD: true,
    SHOUT: true,
    SSET: true,
    STATUS: true,
    SUBSCRIBE: true,
    THREAD: true,
    TRUST: true,
    CHANTYPES: [ '#' ],
    CHANMODES: [ '' ],
    NICKLEN: '256',
    CHANNELLEN: '256',
    TOPICLEN: '444',
    KICKLEN: '444',
    AWAYLEN: '444',
    MAXTARGETS: '1',
    CHARSET: 'UTF-8',
    NETWORK: 'psyced.org',
    CTCP: 'PRESENCE,TS',
    UNIFORMS: 'psyc,xmpp',
    'ARE SUPPORTED BY THIS SERVER': true
  },
  cap: [],
  tags: {}
}

This makes irc-framework return {PREFIX: ''} (among other keys) which is undesired I guess