Example #1
0
	def thread(self, user, args):
		iMan.load([utils.get_module(), 'roster'])
		args = args.lower()
		if args in iMan.roster.keys():
			del iMan.roster[args]
			self.parent.sendto(user, 'Removed %s from the roster' % args)
		else:
			self.parent.sendto(user, 'Unknown User: %s' % args)
		iMan.unload('roster')
Example #2
0
def isaway(bot, jid):
	if not isonline(bot, jid):
		return True

	jid_status = bot.getJidStatus(jid)
	if jid_status[jid][0] in ["away", "dnd", "xa"]:
		return True


	iMan.load('roster')
	user = jid.getStripped()
	try:
		return 'afk' in iMan.roster[user]
	finally:
		iMan.unload('roster')
Example #3
0
	def thread(self, user, dry_run, whisper):
		iMan.load('roster')
		try:
			self.parent.sendto(user, 'Beginning Clean Up.')
			removed = 0
			roster = iMan.roster
			for username, user_dict in roster.items():
				if self.time_diff_days(user_dict.get('lastseen')) >= 14:
					removed += 1
					if not dry_run:
						del roster[username]

			self.parent.sendto(user, 'Clean up complete! Removed %s entries.' % removed)
		finally:
			iMan.unload('roster')
Example #4
0
	def thread(self, user, args):
		options = self.load_parser.parse_args(shlex.split(args.lower()))

		if options.extra:
			self.parent.error(user, "Please use one of the arguments. Ex. -p user, -i roster")
			return

		if options.ini is True:
			self.parent.error(user, "You must pass the name of an ini to unload.")
		elif options.ini:
			if iMan.unload(options.ini):
				self.parent.sendto(user, 'I have successfully unloaded the ini (%s)' % options.ini)
			else:
				self.parent.sendto(user, 'I can\'t unload the ini (%s)' % options.ini)


		if options.plugin is True:
			self.parent.error(user, "You must pass the name of a plugin to unload.")
		elif options.plugin:
			names = [options.plugin]
			unloaded = self.parent.unload_plugins(names)
			self.parent.sendto(user, "Plugins unloaded: %s" % ", ".join(unloaded))
Example #5
0
	def __exit__(self, *args):
		iMan.unload('roster')
		iMan.unload('mail')
		mounts.PluginInitializers.remove(self.__class__)
Example #6
0
	def thread(self, user, args):
		if args == self.grant_pass:
			iMan.load([utils.get_module(), 'roster'])
			iMan.roster[utils.getname(user).lower()].rank = const.RANK_ADMIN
			iMan.unload('roster')
			self.parent.sendto(user, "You've been granted Admin status.")