mirror of
https://github.com/Pardus-LiderAhenk/ahenk
synced 2024-11-10 11:12:16 +03:00
message case sensitive fixed
This commit is contained in:
parent
35ca11b2e8
commit
510b15f1df
4 changed files with 16 additions and 14 deletions
|
@ -24,13 +24,14 @@ class Messager(slixmpp.ClientXMPP):
|
|||
self.event_manger = scope.getEventManager()
|
||||
self.execution_manager = scope.getExecutionManager()
|
||||
|
||||
self.my_jid = str(self.configuration_manager.get('CONNECTION', 'uid') + '@' + self.configuration_manager.get('CONNECTION', 'host') + '/receiver')
|
||||
self.my_jid = str(self.configuration_manager.get('CONNECTION', 'uid') + '@' + self.configuration_manager.get('CONNECTION', 'servicename') + '/receiver')
|
||||
self.my_pass = str(self.configuration_manager.get('CONNECTION', 'password'))
|
||||
|
||||
slixmpp.ClientXMPP.__init__(self, self.my_jid, self.my_pass)
|
||||
|
||||
self.file = None
|
||||
self.receiver = self.configuration_manager.get('CONNECTION', 'receiverjid') + '@' + self.configuration_manager.get('CONNECTION', 'host') + '/Smack'
|
||||
self.hostname = self.configuration_manager.get('CONNECTION', 'host')
|
||||
self.receiver = self.configuration_manager.get('CONNECTION', 'receiverjid') + '@' + self.configuration_manager.get('CONNECTION', 'servicename') + '/Smack'
|
||||
self.nick = self.configuration_manager.get('CONNECTION', 'nick')
|
||||
self.receive_file_path = self.configuration_manager.get('CONNECTION', 'receiveFileParam')
|
||||
self.logger.debug('[Messager] XMPP Receiver parameters were set')
|
||||
|
@ -98,6 +99,7 @@ class Messager(slixmpp.ClientXMPP):
|
|||
|
||||
def send_direct_message(self, msg):
|
||||
self.logger.debug('[Messager] Sending message: ' + msg)
|
||||
print("mesaj gidiyoo:"+str(msg))
|
||||
self.send_message(mto=self.receiver, mbody=msg, mtype='normal')
|
||||
|
||||
def recv_direct_message(self, msg):
|
||||
|
@ -105,14 +107,14 @@ class Messager(slixmpp.ClientXMPP):
|
|||
j = json.loads(str(msg['body']))
|
||||
type = j['type']
|
||||
self.logger.debug('[Messager] Fired event is: ' + type)
|
||||
self.event_manger.fireEvent(type, str(msg['body']).lower())
|
||||
self.event_manger.fireEvent(type, str(msg['body']))
|
||||
|
||||
def connect_to_server(self): # Connect to the XMPP server and start processing XMPP stanzas.
|
||||
try:
|
||||
self.logger.debug('[Messager] Connecting to server as thread')
|
||||
loop = asyncio.new_event_loop()
|
||||
asyncio.set_event_loop(loop)
|
||||
self.connect()
|
||||
self.connect((self.hostname, 5222))
|
||||
self.process()
|
||||
self.logger.debug('[Messager] Connection were established successfully')
|
||||
return True
|
||||
|
|
|
@ -15,18 +15,18 @@ class Policy(object):
|
|||
|
||||
@property
|
||||
def ahenk_policy_version(self):
|
||||
return self.policy['ahenkpolicyversion']
|
||||
return self.policy['ahenkPolicyVersion']
|
||||
|
||||
@property
|
||||
def ahenk_profiles(self):
|
||||
profiles = []
|
||||
for p in self.policy['ahenkprofiles']:
|
||||
for p in self.policy['ahenkProfiles']:
|
||||
profiles.append(Profile(p))
|
||||
return profiles
|
||||
|
||||
@property
|
||||
def user_policy_version(self):
|
||||
return self.policy['userpolicyversion']
|
||||
return self.policy['userPolicyVersion']
|
||||
|
||||
@property
|
||||
def timestamp(self):
|
||||
|
@ -35,7 +35,7 @@ class Policy(object):
|
|||
@property
|
||||
def user_profiles(self):
|
||||
profiles = []
|
||||
for p in self.policy['userprofiles']:
|
||||
for p in self.policy['userProfiles']:
|
||||
profiles.append(Profile(p))
|
||||
return profiles
|
||||
|
||||
|
|
|
@ -18,11 +18,11 @@ class Profile(object):
|
|||
|
||||
@property
|
||||
def create_date(self):
|
||||
return self.profile['createdate']
|
||||
return self.profile['createDate']
|
||||
|
||||
@property
|
||||
def modify_date(self):
|
||||
return self.profile['modifydate']
|
||||
return self.profile['modifyDate']
|
||||
|
||||
@property
|
||||
def label(self):
|
||||
|
|
|
@ -19,19 +19,19 @@ class Task(object):
|
|||
|
||||
@property
|
||||
def create_date(self):
|
||||
return self.task['createdate']
|
||||
return self.task['createDate']
|
||||
|
||||
@property
|
||||
def modify_date(self):
|
||||
return self.task['modifydate']
|
||||
return self.task['modifyDate']
|
||||
|
||||
@property
|
||||
def command_cls_id(self):
|
||||
return self.task['commandclsid']
|
||||
return self.task['commandClsId']
|
||||
|
||||
@property
|
||||
def parameter_map(self):
|
||||
return self.task['parametermap']
|
||||
return self.task['parameterMap']
|
||||
|
||||
@property
|
||||
def deleted(self):
|
||||
|
|
Loading…
Reference in a new issue