def __init__(self, RecipientChooser, MessageBuilder, ItBot, PresenceConfirmationManager, JidHandleGroups, MyConfig):
		DefaultBotEventCoordinator.__init__(self, RecipientChooser, MessageBuilder, ItBot)
		self._PresenceConfManager = PresenceConfirmationManager
		self.__Filter = self._RecipientChooser.getRecipientListModifierByClass(HelpDeskRecipientFilter)
		self.__JidHandleGroups = JidHandleGroups
		self.__emailSender = MyConfig.getUserSupportEmailSender()
		self.__emailReceiver = MyConfig.getUserSupportEmailReceiver()
	def _handleNobodyAvailable(self, Result, sender, receivedMessageBody):
		DefaultBotEventCoordinator._handleNobodyAvailable(self, Result, sender, receivedMessageBody)

		if (Result.shouldSendRelayMessage()):
			self.__sendEmail(receivedMessageBody, sender)

		if (self._PresenceConfManager.hasPendingRequest()):
			self._PresenceConfManager.confirmPresence()
Пример #3
0
    def _handleNobodyAvailable(self, Result, sender, receivedMessageBody):
        DefaultBotEventCoordinator._handleNobodyAvailable(
            self, Result, sender, receivedMessageBody)

        if (Result.shouldSendRelayMessage()):
            self.__sendEmail(receivedMessageBody, sender)

        if (self._PresenceConfManager.hasPendingRequest()):
            self._PresenceConfManager.confirmPresence()
Пример #4
0
 def __init__(self, RecipientChooser, MessageBuilder, ItBot,
              PresenceConfirmationManager, JidHandleGroups, MyConfig):
     DefaultBotEventCoordinator.__init__(self, RecipientChooser,
                                         MessageBuilder, ItBot)
     self._PresenceConfManager = PresenceConfirmationManager
     self.__Filter = self._RecipientChooser.getRecipientListModifierByClass(
         HelpDeskRecipientFilter)
     self.__JidHandleGroups = JidHandleGroups
     self.__emailSender = MyConfig.getUserSupportEmailSender()
     self.__emailReceiver = MyConfig.getUserSupportEmailReceiver()
	def handleMessageReceived(self, sender, receivedMessageBody):
		if self.__senderIsRequestedRecipient(sender, receivedMessageBody):
			if (self.__weShouldForwardPendingMessages(receivedMessageBody)):
				self.__forwardPendingMessagesToAnotherGroup(sender, receivedMessageBody)
			else:
				self.__sendHelpDeskUserConfirmationMessage(sender)
				self.__sendRequestConfirmedMessage(sender)

				self.__confirmPresence()
		else:
			DefaultBotEventCoordinator.handleMessageReceived(self, sender, receivedMessageBody)

			self.__updateConfirmationRequest(sender, receivedMessageBody)
Пример #6
0
    def handleMessageReceived(self, sender, receivedMessageBody):
        if self.__senderIsRequestedRecipient(sender, receivedMessageBody):
            if (self.__weShouldForwardPendingMessages(receivedMessageBody)):
                self.__forwardPendingMessagesToAnotherGroup(
                    sender, receivedMessageBody)
            else:
                self.__sendHelpDeskUserConfirmationMessage(sender)
                self.__sendRequestConfirmedMessage(sender)

                self.__confirmPresence()
        else:
            DefaultBotEventCoordinator.handleMessageReceived(
                self, sender, receivedMessageBody)

            self.__updateConfirmationRequest(sender, receivedMessageBody)
Пример #7
0
 def getBotEventCoordinator(self, ItBot):
     moduleString = self.__botEventCoordinatorClassDict['class']
     if (moduleString):
         BotEventCoordinator = self.__getClassFromModuleString(moduleString)
         return BotEventCoordinator.factory(self, ItBot,
                                            BotEventCoordinator)
     else:
         return DefaultBotEventCoordinator.factory(
             self, ItBot, DefaultBotEventCoordinator)
Пример #8
0
	def getBotEventCoordinator(self, ItBot):
		moduleString = self.__botEventCoordinatorClassDict['class']
		if (moduleString):
			BotEventCoordinator = self.__getClassFromModuleString(moduleString)
			return BotEventCoordinator.factory(self, ItBot, BotEventCoordinator)
		else:
			return DefaultBotEventCoordinator.factory(
				self,
				ItBot,
				DefaultBotEventCoordinator
			)
	def _sendConfirmationMessage(self, sender):
		if not self.__Filter.alreadyMessagedRequester(sender):
			DefaultBotEventCoordinator._sendConfirmationMessage(self, sender)
Пример #10
0
 def _sendConfirmationMessage(self, sender):
     if not self.__Filter.alreadyMessagedRequester(sender):
         DefaultBotEventCoordinator._sendConfirmationMessage(self, sender)