

def flush_legacy_mode_change(self, cli, before, after, before_users, after_users):
    out = str()
    args = []
    mod = 0
    for i in channel_property_items.keys():
        if (before.get(i, False) and (not after.get(i, False))):
            if (mod == 1):
                if ((i == 'ban') or (i == 'quiet') or (i == 'invite-exemption') or (i == 'exemption')):
                    for j in before.get(i, []):
                        if (j not in after.get(i)):
                            out += channel_property_items[i]
                            args.append(j)
                    continue
                out += channel_property_items[i]
                if (before.get(i, False) != True):
                    args.append(before.get(i))
            else:
                mod = 1
                out += '-'
                if ((i == 'ban') or (i == 'quiet') or (i == 'invite-exemption') or (i == 'exemption')):
                    for j in before.get(i, []):
                        if (j not in after.get(i)):
                            out += channel_property_items[i]
                            args.append(j)
                    continue
                out += channel_property_items[i]
                if (before.get(i, False) != True):
                    args.append(before.get(i))
        elif ((not before.get(i, False)) and after.get(i, False)):
            if (mod == 2):
                if ((i == 'ban') or (i == 'quiet') or (i == 'invite-exemption') or (i == 'exemption')):
                    for j in after.get(i):
                        if (j not in before.get(i, [])):
                            out += channel_property_items[i]
                            args.append(j)
                    continue
                out += channel_property_items[i]
                if (after.get(i, False) != True):
                    args.append(after.get(i))
            else:
                mod = 2
                out += '+'
                if ((i == 'ban') or (i == 'quiet') or (i == 'invite-exemption') or (i == 'exemption')):
                    for j in after.get(i):
                        if (j not in before.get(i, [])):
                            out += channel_property_items[i]
                            args.append(j)
                    continue
                out += channel_property_items[i]
                if (after.get(i, False) != True):
                    args.append(after.get(i))
    if (len(out) > 0):
        msg = RFC1459Message.from_data('MODE', source=cli, params=([self.name, out] + args))
        self.dump_message(msg)

dataset/ETHPy150Open mammon-ircd/mammon/mammon/channel.py Channel.flush_legacy_mode_change/original