     
     
 }
+
+extension CWGroupServic: XMPPMUCLightDelegate {
+    func xmppMUCLight(_ sender: XMPPMUCLight, didDiscoverRooms rooms: [DDXMLElement], forServiceNamed serviceName: String) {
+        log.debug(serviceName)
+        log.debug(rooms)
+    }
+}


class CWGroupServic: XMPPModule {
    
    override init!(dispatchQueue queue: DispatchQueue!) {
        super.init(dispatchQueue: queue)
    }
    
}

    
    func fetchJoinGroups() {
        
//        let queryElement = DDXMLElement(name: "query", xmlns: "http://jabber.org/protocol/disco#items")
//        
//        let iqElement = DDXMLElement(name: "iq")
//        iqElement.addAttribute(withName: "type", stringValue: "get")
//        let chatClient = CWChatClient.share
//        
//        iqElement.addAttribute(withName: "from", stringValue: "chenwei@hellochatim.p1.im")
//        iqElement.addAttribute(withName: "to", stringValue: "conference.hellochatim.p1.im")
//        iqElement.addAttribute(withName: "id", stringValue: "getexistroomid")
//
//        iqElement.addChild(queryElement!)
//        log.debug(iqElement)
//        CWChatXMPPManager.share.xmppStream.send(iqElement)
        
        mucLight.discoverRooms(forServiceNamed: "conference.hellochatim.p1.im")
    }
    
    
