View Issue Details

IDProjectCategoryView StatusLast Update
0004772unrealircdpublic2016-10-30 12:02
Reportergms Assigned Tosyzop  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version4.0.7 
Fixed in Version4.0.8-rc1 
Summary0004772: Server->(server/services) Modes specified in PREFIX=(here)xxxxx missing from here CHANMODES=(here),XXX,XXX,XXX
DescriptionWhile parsing modes i noticed channel modes qaohv missing from CHANMODES on link PROTOCTL. While not devastating its not possible to determine if the missing modes are supported by any particular server during server->server handshake.
Steps To ReproduceWhile observing protocol handshake Client/Server. Client gets PREFIX in 005 message but since sending 005 to server during link is not part of the protocol those modes need to be specified in CHANMODES over the PROTOCTL message.
Additional Information            /* Workaround:
                 simply assume certain modes are supported on every
                 ircd and add to section A of CHANMODES=A,B,C,D
                 ban allready set in this output
            */
            supported[0] += 'qaohv';
            /* Workaround: end */


            var set = false, type = -1;
            console.log('MODE CHANGE Supported:', supported, 'Changing:', modes, 'Parameters:', args, 'Original Params:', params);
            modes.split('').forEach(function(mode) {
                if ('+' == mode) set = true;
                else if ('-' == mode) set = false;
                else {
                    for (var i = 0, c = supported.length; i<c; i++) if (supported[i].indexOf(mode) >= 0) type = i;
                    switch(type) {
                        case 0:
                        case 1:
                            if (!channel._modes[mode]) channel._modes[mode] = [];
                            var parm = args.shift();
                            if (set) channel._modes[mode].push(parm);
                            else channel._modes[mode].splice(channel._modes[mode].indexOf(parm),1);
                            break;
                        case 2:
                            if (set) channel._modes[mode] = args.shift();
                            else channel._modes[mode] = false;
                            break;
                        case 3:
                            channel._modes[mode] = set;
                            break;
                        default:
                            console.log('Unkown Mode:', mode);
                    }
                }
            });
            console.log('MODE RESULTS:', channel._modes);

            /*
            /mode #services +oskbl WebServ pass somenick@host 10
            MODE CHANGE Supported: [ 'beIqaohvqaohvqaohvqaohvqaohvqaohvqaohvqaohvqaohvqaohvqaohvqaohvqaohv',
              'kLf',
              'l',
              'psmntirzMQNRTOVKDdGPZSCc' ] Changing: +slok Parameters: [ '10', 'WebServ', 'pass' ] Original Params: [ '#services', '+slok'
            , '10', 'WebServ', 'pass' ]
            MODE RESULTS: { s: true,
              l: '10',
              k: [ 'pass' ],
              b: [ '*!somenick@host' ],
              o: [ 'WebServ' ] }
            rawMODE [ '#services', '+slok', '10', 'WebServ', 'pass' ]


            */
TagsNo tags attached.
3rd party modules

Activities

gms

2016-10-23 03:43

reporter   ~0019484

MODE CHANGE Supported: [ 'beIqaohvqaohvqaohvqaohvqaohvqaohvqaohvqaohvqaohvqaohvqaohvqaohvqaohv',

This is a result of appending modes during the MODE change event for the purpose of copy/paste this bug report supported[0] += 'qaohv'; actually occurs in PROTOCTL event only and correctly sets the supported modes. sorry i missed this during reporting.

syzop

2016-10-30 11:59

administrator   ~0019486

CHANMODES= purpose is indeed exactly for what you are trying to do: so you know when a channel mode requires a parameter or not, this so you can skip (also called 'eat') the parameter. This way you don't need to hardcode this stuff for every channel mode, which are modular after all and may be different on different networks.

syzop

2016-10-30 12:01

administrator   ~0019487

I solved the issue by sending PREFIX= in PROTOCTL. This so it matches the client-side where PREFIX modes are also ommitted from channel modes, and also so you can easily diferentiate between list modes (beI) and nick modes (vhoaq).

So.. you still need to do some string concatenation in your code but this way you have all the information you need, or at least starting 4.0.8.. I don't have a time machine so can't fix previous releases :)

[unreal40 d504fbe] Send PREFIX= in PROTOCTL to servers (0004772).
https://github.com/unrealircd/unrealircd/commit/d504fbe04cd4b4e7f12d3f1f350edc4574bff4ec

Issue History

Date Modified Username Field Change
2016-10-23 03:29 gms New Issue
2016-10-23 03:43 gms Note Added: 0019484
2016-10-30 11:59 syzop Note Added: 0019486
2016-10-30 11:59 syzop Status new => resolved
2016-10-30 11:59 syzop Resolution open => fixed
2016-10-30 11:59 syzop Assigned To => syzop
2016-10-30 12:01 syzop Note Added: 0019487
2016-10-30 12:02 syzop Fixed in Version => 4.0.8-rc1