def OnBlipSubmitted(self, event, wavelet): """ new blip added. here is where the command dispatching takes place. """ wevent = WaveEvent() wevent.parse(self, event, wavelet) wevent.auth = wevent.userhost wave = wevent.chan #wave.data.seenblips += 1 wave.data.lastedited = time.time() self.doevent(wevent)
def OnSelfAdded(self, event, wavelet): """ invoked when the robot has been added. """ logging.warn('wave - joined "%s" (%s) wave' % (wavelet._wave_id, wavelet._title)) wevent = WaveEvent() wevent.parse(self, event, wavelet) logging.debug("wave - owner is %s" % wevent.chan.data.owner) wevent.chan.data.json_data = wavelet.serialize() wevent.chan.save() wevent.reply("Welcome to %s (see !help) or http://jsonbot.appspot.com/docs/html/index.html" % getversion()) callbacks.check(self, wevent)
def OnParticipantsChanged(self, event, wavelet): """ invoked when any participants have been added/removed. """ wevent = WaveEvent() wevent.parse(self, event, wavelet) whitelist = wevent.chan.data.whitelist if not whitelist: whitelist = wevent.chan.data.whitelist = [] participants = event.participants_added logging.warning("wave - %s - %s joined" % (wevent.chan.data.title, participants)) if wevent.chan.data.protected: for target in participants: if target not in whitelist and target != '*****@*****.**' and target != wevent.chan.data.owner: logging.warn("wave - %s - setting %s to read-only" % (wevent.chan.data.title, target)) wevent.root.participants.set_role(target, waveapi.wavelet.Participants.ROLE_READ_ONLY) callbacks.check(self, wevent)
def OnParticipantsChanged(self, event, wavelet): """ invoked when any participants have been added/removed. """ wevent = WaveEvent() wevent.parse(self, event, wavelet) whitelist = wevent.chan.data.whitelist if not whitelist: whitelist = wevent.chan.data.whitelist = [] participants = event.participants_added logging.warning("wave - %s - %s joined" % (wevent.chan.data.title, participants)) if wevent.chan.data.protected: for target in participants: if target not in whitelist and target != '*****@*****.**' and target != wevent.chan.data.owner: logging.warn("wave - %s - setting %s to read-only" % (wevent.chan.data.title, target)) wevent.root.participants.set_role( target, waveapi.wavelet.Participants.ROLE_READ_ONLY) callbacks.check(self, wevent)
def OnSelfAdded(self, event, wavelet): """ invoked when the robot has been added. """ logging.warn('wave - joined "%s" (%s) wave' % (wavelet._wave_id, wavelet._title)) wevent = WaveEvent() wevent.parse(self, event, wavelet) logging.debug("wave - owner is %s" % wevent.chan.data.owner) wevent.chan.data.json_data = wavelet.serialize() wevent.chan.save() wevent.reply( "Welcome to %s (see !help) or http://jsonbot.appspot.com/docs/html/index.html" % getversion()) callbacks.check(self, wevent)