~mzbot-hackers/mzbot/pushsomething

« back to all changes in this revision

Viewing changes to mzbot/wolf.py

  • Committer: Marien Zwart
  • Date: 2010-07-02 21:10:03 UTC
  • Revision ID: marienz@cyclops-20100702211003-kvg1i42ft2907b2l
Do not ping users set away.

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
 
11
11
from zope.interface import implements
12
12
 
 
13
from twisted.internet import defer
 
14
 
13
15
from mzbot import commands, ibot
14
16
 
15
17
 
308
310
        self.chanmsg(GOAT.format(target, user.uname))
309
311
 
310
312
    @commands.args()
 
313
    @defer.inlineCallbacks
311
314
    def handle_ping(self, user, source):
312
315
        now = self.clock.seconds()
313
316
        if self.lastping + self.pingtime > now:
317
320
        self.lastping = now
318
321
        self.pinger = user
319
322
 
 
323
        # Update away status.
 
324
        yield self.chanobj.who()
 
325
 
320
326
        self.chanmsg(u'{0} says PING!!! {1}'.format(
321
327
                user.uname, u' '.join(sorted(
322
328
                        lurker.uname
323
329
                        for lurker in self.chanobj.users.itervalues()
324
330
                        if lurker not in self.players
 
331
                        and not lurker.away
325
332
                        and lurker is not user))))
326
333
 
327
334
    # TODO: there was an "fping" ignoring the timer, but that seems silly.