- if new_status in [current_status, (current_status[0], None, None)] :
- distributeXmppMsg("Status recieved but filtered: (%s,%s,%s)" % new_status ,debug=True)
- elif current_status == (None, None, None):
- current_status=new_status
- distributeXmppMsg("Initial Status: (%s,%s,%s)" % new_status ,debug=True)
- else:
- (status,req,req_comment) = new_status
- high_priority_msg = False
- req_msg=""
- status_msg=""
- comment_msg=""
- if status == "opened":
- status_msg = uwscfg.msg_status_opened_msg
- elif status == "closed":
- status_msg = uwscfg.msg_status_closed_msg
- elif status == "error":
- status_msg = uwscfg.msg_status_error_msg
- high_priority_msg=True
- else:
- distributeXmppMsg("Unknown Status: (%s,%s,%s)" % new_status ,debug=True)
- return
- if req:
- req_msg = uwscfg.msg_request_msg.replace("${request}",req)
- if req_comment:
- comment_msg = uwscfg.msg_comment_msg.replace("${comment}",req_comment)
- msg = uwscfg.msg_format.replace("${status_msg}", status_msg).replace("${request_msg}",req_msg).replace("${comment_msg}",comment_msg)
- distributeXmppMsg(msg, high_priority=high_priority_msg)
- current_status=new_status
+ if new_status[0] == "error":
+ distributeXmppMsg(uwscfg.msg_status_error_msg, high_priority=True)
+ elif current_status[0] != new_status[0]:
+ distributeXmppMsg("Status: (%s,%s,%s,%s)" % new_status ,debug=True)
+ current_status=new_status