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