@@ 77,18 77,21 @@ sendPresenceToMUC config presence@XMPP.Presence {
XMPP.presencePayloads = payloads
} targetMuc tag = do
ghost <- isGhost config from
- when (not ghost) $ do
- mkSession config typ (Just from) target
+ let typ'
+ | ghost = XMPP.PresenceUnavailable
+ | otherwise = typ
+ mkSession config typ' (Just from) target
- XMPP.putStanza $ presence {
- XMPP.presenceFrom = Just (proxyJid config from),
- XMPP.presenceTo = Just target,
- XMPP.presencePayloads = map (\payload ->
- case XML.isNamed (s"{http://jabber.org/protocol/muc#user}x") payload of
- [_] -> mucJoinX
- _ -> payload
- ) payloads
- }
+ XMPP.putStanza $ presence {
+ XMPP.presenceType = typ',
+ XMPP.presenceFrom = Just (proxyJid config from),
+ XMPP.presenceTo = Just target,
+ XMPP.presencePayloads = map (\payload ->
+ case XML.isNamed (s"{http://jabber.org/protocol/muc#user}x") payload of
+ [_] -> mucJoinX
+ _ -> payload
+ ) payloads
+ }
where
nickReplacement = maybe id replaceNotInClass (Config.nickChars targetMuc)
target = maybeAddNick (Config.jid targetMuc) $ nickReplacement $