Exemplo n.º 1
0
    def on_join(self, c, e):
        channel = e.target()

        # If we're joining, we need to open the channel for us first.
        if channel not in self.channels:
            self.channels[channel] = Channel(self, channel)
            if (channel.lower() in self.crucialChannels):
                self.insertTab(1, self.channels[channel], channel)    #CAVEAT: This is assumes a server tab exists.
                self.client.localBroadcast.connect(self.channels[channel].printRaw)
                self.channels[channel].printAnnouncement("Welcome to Forged Alliance Forever!", "red", "+3")
                self.channels[channel].printAnnouncement("Check out the wiki: http://wiki.faforever.com for help with common issues.", "white", "+1")
                self.channels[channel].printAnnouncement("", "black", "+1")
                self.channels[channel].printAnnouncement("", "black", "+1")

            else:
                self.addTab(self.channels[channel], channel)


            if channel.lower() in self.crucialChannels: #Make the crucial channels not closeable, and make the last one the active one
                self.setCurrentWidget(self.channels[channel])
                self.tabBar().setTabButton(self.currentIndex(), QtGui.QTabBar.RightSide, None)

        name, id, elevation, hostname = parse_irc_source(e.source())
        self.channels[channel].addChatter(name, id, elevation, hostname, True)

        if channel.lower() in self.crucialChannels and name != self.client.login:
            # TODO: search better solution, that html in nick & channel no rendered
            self.client.notificationSystem.on_event(ns.Notifications.USER_ONLINE,
                                                    {'user': name, 'channel': channel})
        self.channels[channel].resizing()
Exemplo n.º 2
0
    def on_join(self, c, e):
        channel = e.target()

        # If we're joining, we need to open the channel for us first.
        if channel not in self.channels:
            newch = Channel(self, channel, self._chatters, self._me)
            if channel.lower() in self.crucialChannels:
                self.add_channel(
                    channel, newch,
                    1)  # CAVEAT: This is assumes a server tab exists.
                self.client.localBroadcast.connect(newch.print_raw)
                newch.print_announcement("Welcome to Forged Alliance Forever!",
                                         "red", "+3")
                wiki_link = Settings.get("WIKI_URL")
                wiki_msg = "Check out the wiki: {} for help with common issues.".format(
                    wiki_link)
                newch.print_announcement(wiki_msg, "white", "+1")
                newch.print_announcement("", "black", "+1")
                newch.print_announcement("", "black", "+1")
            else:
                self.add_channel(channel, newch)

            if channel.lower(
            ) in self.crucialChannels:  # Make the crucial channels not closeable, and make the last one the active one
                self.setCurrentWidget(self.channels[channel])
                self.tabBar().setTabButton(self.currentIndex(),
                                           QtWidgets.QTabBar.RightSide, None)

        name, _id, elevation, hostname = parse_irc_source(e.source())
        self._add_chatter(name, hostname)
        self._add_chatter_channel(self._chatters[name], elevation, channel,
                                  True)
Exemplo n.º 3
0
    def on_pubmsg(self, c, e):
        name, id, elevation, hostname = parse_irc_source(e.source())
        target = e.target()
        if name not in self._chatters or target not in self.channels:
            return

        if not self.should_ignore(self._chatters[name]):
            self.channels[target].print_msg(name, "\n".join(e.arguments()))
Exemplo n.º 4
0
    def on_privmsg(self, c, e):
        name, id, elevation, hostname = parse_irc_source(e.source())

        if self.client.players.isFoe(id):
            return

        # Create a Query if it's not open yet, and post to it if it exists.
        if self.openQuery(name):
            self.channels[name].printMsg(name, "\n".join(e.arguments()))
Exemplo n.º 5
0
    def on_privmsg(self, c, e):
        name, id, elevation, hostname = parse_irc_source(e.source())

        if self.client.players.isFoe(id):
            return

        # Create a Query if it's not open yet, and post to it if it exists.
        if self.openQuery(name):
            self.channels[name].printMsg(name, "\n".join(e.arguments()))
Exemplo n.º 6
0
    def on_privmsg(self, c, e):
        name, id, elevation, hostname = parse_irc_source(e.source())
        if name not in self._chatters:
            return
        chatter = self._chatters[name]

        if self.should_ignore(chatter):
            return

        # Create a Query if it's not open yet, and post to it if it exists.
        if self.open_query(chatter):
            self.channels[name].print_msg(name, "\n".join(e.arguments()))
Exemplo n.º 7
0
    def on_action(self, c, e):
        name, id, elevation, hostname = parse_irc_source(e.source())#user2name(e.source())
        target = e.target()

        if self.client.players.isFoe(id):
            return

        # Create a Query if it's not an action intended for a channel
        if target not in self.channels:
            self.openQuery(name)
            self.channels[name].printAction(name, "\n".join(e.arguments()))
        else:
            self.channels[target].printAction(name, "\n".join(e.arguments()))
Exemplo n.º 8
0
    def on_action(self, c, e):
        name, id, elevation, hostname = parse_irc_source(
            e.source())  #user2name(e.source())
        target = e.target()

        if self.client.players.isFoe(id):
            return

        # Create a Query if it's not an action intended for a channel
        if target not in self.channels:
            self.openQuery(name)
            self.channels[name].printAction(name, "\n".join(e.arguments()))
        else:
            self.channels[target].printAction(name, "\n".join(e.arguments()))
Exemplo n.º 9
0
    def on_action(self, c, e):
        name, id, elevation, hostname = parse_irc_source(e.source())
        if name not in self._chatters:
            return
        chatter = self._chatters[name]
        target = e.target()

        if self.should_ignore(chatter):
            return

        # Create a Query if it's not an action intended for a channel
        if target not in self.channels:
            self.open_query(chatter)
            self.channels[name].print_action(name, "\n".join(e.arguments()))
        else:
            self.channels[target].print_action(name, "\n".join(e.arguments()))
Exemplo n.º 10
0
    def on_join(self, c, e):
        channel = e.target()

        # If we're joining, we need to open the channel for us first.
        if channel not in self.channels:
            self.channels[channel] = Channel(self, channel)
            if (channel.lower() in self.crucialChannels):
                self.insertTab(
                    1, self.channels[channel],
                    channel)  #CAVEAT: This is assumes a server tab exists.
                self.client.localBroadcast.connect(
                    self.channels[channel].printRaw)
                self.channels[channel].printAnnouncement(
                    "Welcome to Forged Alliance Forever!", "red", "+3")
                self.channels[channel].printAnnouncement(
                    "Check out the wiki: http://wiki.faforever.com for help with common issues.",
                    "white", "+1")
                self.channels[channel].printAnnouncement("", "black", "+1")
                self.channels[channel].printAnnouncement("", "black", "+1")

            else:
                self.addTab(self.channels[channel], channel)

            if channel.lower(
            ) in self.crucialChannels:  #Make the crucial channels not closeable, and make the last one the active one
                self.setCurrentWidget(self.channels[channel])
                self.tabBar().setTabButton(self.currentIndex(),
                                           QtGui.QTabBar.RightSide, None)

        name, id, elevation, hostname = parse_irc_source(e.source())
        self.channels[channel].addChatter(name, id, elevation, hostname, True)

        if channel.lower(
        ) in self.crucialChannels and name != self.client.login:
            # TODO: search better solution, that html in nick & channel no rendered
            self.client.notificationSystem.on_event(
                ns.Notifications.USER_ONLINE, {
                    'user': id,
                    'channel': channel
                })
        self.channels[channel].resizing()
Exemplo n.º 11
0
    def on_pubmsg(self, c, e):
        name, id, elevation, hostname = parse_irc_source(e.source())
        target = e.target()

        if target in self.channels and not self.client.players.isFoe(id):
            self.channels[target].printMsg(name, "\n".join(e.arguments()))
Exemplo n.º 12
0
    def on_pubmsg(self, c, e):
        name, id, elevation, hostname = parse_irc_source(e.source())
        target = e.target()

        if target in self.channels and not self.client.players.isFoe(id):
            self.channels[target].printMsg(name, "\n".join(e.arguments()))