func main() {
spaceapidata.AddSpaceFeed("calendar", "application/rss+xml", "http://grical.realraum.at/s/?query=!realraum&view=rss")
spaceapidata.AddSpaceFeed("google+", "text/html", "https://plus.google.com/113737596421797426873")
- spaceapidata.AddSpaceContactInfo("+43780700888524", "irc://irc.oftc.net/#realraum", "realraum@realraum.at", "realraum@realraum.at", "realraum@realraum.at")
+ spaceapidata.AddSpaceContactInfo("+43780700888524", "irc://irc.oftc.net/#realraum", "realraum@realraum.at", "realraum@realraum.at", "realraum@realraum.at", "vorstand@realraum.at")
eventqueue := make(chan string)
ticker := time.NewTicker(time.Duration(15) * time.Minute)
go readFromUSocket("/var/run/tuer/presence.socket", eventqueue)
}
}
-func (nsi SpaceInfo) AddSpaceContactInfo(phone, irc, email, ml, jabber string) SpaceInfo {
+func (nsi SpaceInfo) AddSpaceContactInfo(phone, irc, email, ml, jabber, issuemail string) SpaceInfo {
nsi["contact"] = SpaceInfo{
"phone": phone,
"email": email,
"ml": ml,
- "jabber": jabber}
+ "jabber": jabber,
+ "issue-mail": issuemail}
+ nsi["issue-report-channels"] = [3]string{"issue-mail","email","ml"}
return nsi
}
nsi["status"] = status
nsi["open"] = open
nsi["lastchange"] = time.Now().Unix()
+ state, ok := nsi["state"].(SpaceInfo)
+ if ok {
+ state["message"] = status
+ state["open"] = open
+ state["lastchange"] = nsi["lastchange"]
+ }
}
func NewSpaceInfo(space string, url string, logo string, open_icon string, closed_icon string, lat float64, lon float64) SpaceInfo {
"logo": logo,
"open": false,
"lastchange": time.Now().Unix(),
- "icon": SpaceInfo{
- "open": open_icon,
- "closed": closed_icon},
- "location": SpaceInfo{
- "lat": lat,
- "lon": lon},
- "contact" : SpaceInfo {} }
+ "icon": SpaceInfo{
+ "open": open_icon,
+ "closed": closed_icon,
+ },
+ "state": SpaceInfo{
+ "open": false,
+ "lastchange":time.Now().Unix(),
+ "icon": SpaceInfo{
+ "open": open_icon,
+ "closed": closed_icon},
+ },
+ "location": SpaceInfo{
+ "lat": lat,
+ "lon": lon},
+ "contact" : SpaceInfo {},
+ }
return nsi
}