~singpolyma/cheogram

239010545e166910b9c97e1a5eace153de36abb0 — Stephen Paul Weber 2 months ago 159d54f
StatsD for presence probe to tel
1 files changed, 2 insertions(+), 1 deletions(-)

M Main.hs
M Main.hs => Main.hs +2 -1
@@ 793,7 793,8 @@ componentStanza (ComponentContext { db, componentJid, sendIQ, maybeAvatar }) (Re
componentStanza _ (ReceivedPresence (Presence { presenceType = PresenceProbe, presenceFrom = Just from, presenceTo = Just to@JID { jidNode = Just node } }))
	| Just (_:_:_) <- mapM localpartToURI (T.split (==',') $ strNode node) = do
	return $ [mkStanzaRec $ telAvailable to from []]
componentStanza (ComponentContext { db, smsJid = (Just smsJid), componentJid }) (ReceivedPresence (Presence { presenceType = PresenceProbe, presenceFrom = Just from, presenceTo = Just to@JID { jidNode = Just _ } })) = do
componentStanza (ComponentContext { db, smsJid = (Just smsJid), componentJid, pushStatsd }) (ReceivedPresence (Presence { presenceType = PresenceProbe, presenceFrom = Just from, presenceTo = Just to@JID { jidNode = Just _ } })) = do
	pushStatsd [StatsD.stat ["presenceprobe", "tel"] 1 "c" Nothing]
	routeDiscoOrReply db componentJid from smsJid "CHEOGRAM%query-then-send-presence" Nothing $ telAvailable to from []
componentStanza (ComponentContext { maybeAvatar = Just (Avatar hash _ b64) }) (ReceivedIQ (iq@IQ { iqType = IQGet, iqTo = Just to@JID { jidNode = Nothing }, iqFrom = Just from, iqID = Just id, iqPayload = Just p }))
	| [items] <- isNamed (s"{http://jabber.org/protocol/pubsub}items") =<<