Exemple #1
0
def onQuit(e):
    to_write = "%s%s leaves%s" % (prefix(e), format_info_source(e), text(e))
    
    for channame in chaninfo.channels(e.network):
        if chaninfo.ison(e.network, channame, e.source):
            window = windows.get(windows.ChannelWindow, e.network, channame)
            if window:
                window.write(to_write)
def onQuit(e):
    to_write = "%s%s leaves%s" % (prefix(e), format_info_source(e), text(e))

    for channame in chaninfo.channels(e.network):
        if chaninfo.ison(e.network, channame, e.source):
            window = windows.get(windows.ChannelWindow, e.network, channame,
                                 core)
            if window:
                window.write(to_write)
Exemple #3
0
def onQuit(e):
    to_write = "%s quit (%s)" % (e.source, e.text)
    
    for channame in chaninfo.channels(e.network):
        if chaninfo.ison(e.network, channame, e.source):
            window = windows.get(windows.ChannelWindow, e.network, channame)
            if window:
                f = log_file(e.network, window.id)
                
                f.write(to_write)
def onText(e):
    if chaninfo.ischan(e.network, e.target):
        if not hasattr(e.window, 'recent_speakers'):
            e.window.recent_speakers = []

        for nick in e.window.recent_speakers:
            if nick == e.source or not chaninfo.ison(e.network, e.target,
                                                     nick):
                e.window.recent_speakers.remove(nick)

        e.window.recent_speakers.insert(0, e.source)
Exemple #5
0
def onQuit(e):
    reps = {
        'nick':e.source,
        'address':e.address,
        'text':e.text,
        'timestamp':time.strftime(theme.get('TimeStamp',default.get('TimeStamp'))),
        'pre':theme.get('Prefix',default.get('Prefix'))
    }
    for window in windows.get_with(network=e.network):
        if chaninfo.ison(e.network, window.id, e.source):
            output('Quit',None,window,reps,widgets.EVENT)
Exemple #6
0
def nick_completer(window, left, right, text):
    if isinstance(window, windows.QueryWindow):
        yield window.id

    recent_speakers = getattr(window, 'recent_speakers', ())

    for nick in recent_speakers:
        if chaninfo.ison(window.network, window.id, nick):
            yield nick

    for nick in chaninfo.nicks(window.network, window.id):
        if nick not in recent_speakers:
            yield nick
Exemple #7
0
def onText(e):
    if chaninfo.ischan(e.network, e.target):
        if not hasattr(e.window, 'recent_speakers'):
            e.window.recent_speakers = []

        for nick in e.window.recent_speakers:
            if nick == e.source or not chaninfo.ison(
                    e.network,
                    e.target,
                    nick):
                e.window.recent_speakers.remove(nick)

        e.window.recent_speakers.insert(0, e.source)
def nick_completer(window, left, right, text):
    if isinstance(window, windows.QueryWindow):
        yield window.id

    recent_speakers = getattr(window, 'recent_speakers', ())

    for nick in recent_speakers:
        if chaninfo.ison(window.network, window.id, nick):
            yield nick

    for nick in chaninfo.nicks(window.network, window.id):
        if nick not in recent_speakers:
            yield nick
Exemple #9
0
def onNick(e):
    color = getsourcecolor(e)
    if e.source == e.network.me:
        to_write = "%s%sYou are now known as %s" % (prefix(e), color, e.target)
    else:
        to_write = "%s%s%s is now known as %s" % (prefix(e), color, e.source, e.target)
    
    if e.source == e.network.me:
        for window in windows.get_with(network=e.network):
            window.write(to_write)
    else:
        for channame in chaninfo.channels(e.network):
            if chaninfo.ison(e.network,channame,e.source):
                window = windows.get(windows.ChannelWindow, e.network, channame)
                if window:
                    window.write(to_write)
def onNick(e):
    color = getsourcecolor(e)
    if e.source == e.network.me:
        to_write = "%s%sYou are now known as %s" % (prefix(e), color, e.target)
    else:
        to_write = "%s%s%s is now known as %s" % (prefix(e), color, e.source,
                                                  e.target)

    if e.source == e.network.me:
        for window in windows.get_with(core.manager, network=e.network):
            window.write(to_write)
    else:
        for channame in chaninfo.channels(e.network):
            if chaninfo.ison(e.network, channame, e.source):
                window = windows.get(windows.ChannelWindow, e.network,
                                     channame)
                if window:
                    window.write(to_write)
Exemple #11
0
def onNick(e):
    if e.source == e.network.me:
        to_write = 'You are now known as %s' % e.target
    
        for window in windows.get_with(network=e.network):
            f = log_file(e.network, window.id)
            
            f.write(to_write)
    else:
        to_write = '%s is now known as %s' % (e.source, e.target)
    
        for channame in chaninfo.channels(e.network):
            if chaninfo.ison(e.network,channame,e.source):
                window = windows.get(windows.ChannelWindow, e.network, channame)
                if window:
                    f = log_file(e.network, window.id)
                    
                    f.write(to_write)
Exemple #12
0
def is_nick(e):
    return isinstance(e.window, windows.ChannelWindow) and \
        chaninfo.ison(e.window.network, e.window.id, e._target)
Exemple #13
0
def can_see(network,nick):
    for window in chaninfo.channels(network):
        if chaninfo.ison(network, window, nick):
            return True
    return False
Exemple #14
0
def is_nick(e):
    return isinstance(e.window, windows.ChannelWindow) and \
            chaninfo.ison(e.window.network, e.window.id, e._target)