X-Git-Url: https://git.realraum.at/?a=blobdiff_plain;f=update-xmpp-status.py;h=04bd22cac0de9ee56ed82334c9cbebd36b9fa9b0;hb=d1d4f8e2439fbe19fca819e9b81ef1e0451dc4c5;hp=14c80078d1fad3a0467baee5db3090ee76d8240c;hpb=3a65dac5066d908f5a2c869a349e12164f57aab4;p=svn42.git diff --git a/update-xmpp-status.py b/update-xmpp-status.py index 14c8007..04bd22c 100755 --- a/update-xmpp-status.py +++ b/update-xmpp-status.py @@ -33,6 +33,7 @@ class UWSConfig: self.config_parser.set('xmpp','recipients_normal','xro@jabber.tittelbach.at otti@wirdorange.org') self.config_parser.set('xmpp','recipients_nooffline','the-equinox@jabber.org') self.config_parser.add_section('msg') + self.config_parser.set('msg','bored',"Somebody is bored and in need of company. Go Visit !") self.config_parser.set('msg','format',"${status_msg}${request_msg}${comment_msg}") self.config_parser.set('msg','status_opened_msg',"RealRaum door now open") self.config_parser.set('msg','status_closed_msg',"RealRaum door now closed") @@ -268,6 +269,7 @@ distributeXmppMsg("update-xmpp-status.py started", debug=True) RE_STATUS = re.compile(r'Status: (\w+), idle') RE_REQUEST = re.compile(r'Request: (\w+) (?:Card )?(.+)') RE_PRESENCE = re.compile(r'Presence: (yes|no)') +RE_BUTTON = re.compile(r'button\d?') RE_ERROR = re.compile(r'Error: (.+)') while True: try: @@ -290,6 +292,10 @@ while True: if line == "": raise Exception("EOF on Socket, daemon seems to have quit") + m = RE_BUTTON.match(line) + if not m is None: + distributeXmppMsg(uwscfg.msg_bored) + continue m = RE_PRESENCE.match(line) if not m is None: formatAndDistributePresence(m.group(1))