+def sendXmppMsg(recipients, msg, resource = "torwaechter", addtimestamp = True, noofflinemsg = False):
+ if type(recipients) == types.ListType:
+ recipients = " ".join(recipients)
+ if type(recipients) == type.UnicodeType:
+ recipients = recipients.decode("utf-8")
+ if type(recipients) != types.StringType:
+ raise Exception("list of recipients in unknown format, can't send message")
+ if recipients == "" or msg == "":
+ return
+
+ sendxmpp_cmd = "sendxmpp -u realrauminfo -p 5SPjTdub -j jabber.tittelbach.at -t "
+ if resource:
+ sendxmpp_cmd += "-r %s " % resource
+ if noofflinemsg:
+ sendxmpp_cmd += "--headline "
+ sendxmpp_cmd += recipients
+
+ if addtimestamp:
+ msg += time.strftime(" (%Y-%m-%d %T)")
+
+ logging.debug("Starting " + sendxmpp_cmd)