import (
"./spaceapi"
"./r3xmppbot"
+ //pubsub "github.com/tuxychandru/pubsub"
+ "flag"
"bufio"
"fmt"
"net"
re_querystresc_ *regexp.Regexp = regexp.MustCompile("[^\x30-\x39\x41-\x7E]")
spaceapidata spaceapi.SpaceInfo = spaceapi.NewSpaceInfo("realraum", "http://realraum.at", "http://realraum.at/logo-red_250x250.png", "http://realraum.at/logo-re_open_100x100.png", "http://realraum.at/logo-re_empty_100x100.png",47.065779129, 15.442322614).AddSpaceAddress("Jakoministr. 16 ground level left, 8010 Graz, Austria")
statusstate *SpaceState = new(SpaceState)
+ presence_socket_path_ string
xmpp_presence_events_chan_ chan interface{}
+ xmpp_login_ struct {jid string; pass string}
+ xmpp_bot_authstring_ string
)
+
+var flagvar int
+func init() {
+ flag.StringVar(&xmpp_login_.jid, "xjid", "realrauminfo@realraum.at/Tuer", "XMPP Bot Login JID")
+ flag.StringVar(&xmpp_login_.pass, "xpass", "", "XMPP Bot Login Password")
+ flag.StringVar(&xmpp_bot_authstring_, "xbotauth", "", "String that user use to authenticate themselves to the bot")
+ flag.StringVar(&presence_socket_path_,"presencesocket", "/var/run/tuer/presence.socket", "Path to presence socket")
+ flag.Parse()
+}
+
+
//-------
func updateStatusString() {
var err error
var bot *r3xmppbot.XmppBot
- bot, xmpp_presence_events_chan_, err = r3xmppbot.NewStartedBot("realrauminfo@realraum.at/Tuer", "d7ynC6Dg", "r3alraumOLGAXMPPInfos", true)
+ bot, xmpp_presence_events_chan_, err = r3xmppbot.NewStartedBot(xmpp_login_.jid, xmpp_login_.pass, xmpp_bot_authstring_, true)
if err != nil {
fmt.Println(err)
return
defer close(eventqueue)
ticker := time.NewTicker(time.Duration(7) * time.Minute)
- go readFromUSocket("/var/run/tuer/presence.socket", eventqueue)
+ go readFromUSocket(presence_socket_path_, eventqueue)
for {
select {
case e := <-eventqueue: