@@ 625,13 625,18 @@ componentStanza _ toVitelity toComponent _ (ReceivedIQ (IQ { iqType = IQResult,
| Just tel <- strNode <$> jidNode to,
fromString "CHEOGRAMCREATE%" `T.isPrefixOf` id = do
writeStanzaChan toVitelity $ mkSMS tel (mconcat [fromString "* You have created ", bareTxt from])
- queryDisco toComponent from to
+ forM_ (parseJID $ bareTxt to <> fromString "/create") $
+ queryDisco toComponent from
componentStanza db _ toComponent componentHost (ReceivedIQ (IQ { iqType = IQResult, iqTo = Just to, iqFrom = Just from, iqPayload = Just p }))
- | [query] <- isNamed (fromString "{http://jabber.org/protocol/disco#info}query") p = do
+ | Just tel <- strNode <$> jidNode to,
+ [query] <- isNamed (fromString "{http://jabber.org/protocol/disco#info}query") p = do
let vars = mapMaybe (attributeText (fromString "var")) $
isNamed (fromString "{http://jabber.org/protocol/disco#info}feature") =<< elementChildren query
let muc_membersonly = fromEnum $ fromString "muc_membersonly" `elem` vars
True <- TC.runTCM $ TC.put db (T.unpack (formatJID from) <> "\0muc_membersonly") muc_membersonly
+ when (fmap strResource (jidResource to) == Just (fromString "create")) $ do
+ regJid <- tcGetJID db tel "registered"
+ forM_ regJid $ \jid -> forM_ (parseJID $ bareTxt to) $ \to -> sendInvite db toComponent jid (Invite from to Nothing Nothing)
joinStartupTels db toComponent componentHost from to
componentStanza _ _ toComponent _ (ReceivedIQ (iq@IQ { iqType = typ }))
| typ `elem` [IQGet, IQSet] =