def register(me, client, real):
    """register as clients/listeners."""
    par = me.par()
    if not par:
        return
    clid = id(client)
    if real:
        par.clients[clid] = client
    else:
        del par.clients[clid]
