 
 open class XMPPConnection:NSObject{
     var xmppStream: XMPPStream
-
+    
     let hostName: String
     let userJID: XMPPJID
     let hostPort: UInt16
     let password: String
     
     var xmppDelegate:XMPPDelegate?
-
+    
     
     public init(hostName: String, userJIDString: String, hostPort: UInt16 = 5222, password: String, delegate:XMPPDelegate) {
         
         self.hostName = hostName
         self.hostPort = hostPort
         self.password = password
-
+        
         let userJID = XMPPJID(string: userJIDString)
         
         self.xmppStream = XMPPStream()

        print("Stream: Connected")
        try! stream.authenticate(withPassword: self.password)
    }
    
    public func xmppStreamDidAuthenticate(_ sender: XMPPStream!) {
        self.xmppStream.send(XMPPPresence())
        print("Stream: Authenticated")
        self.xmppDelegate?.xmppConnectionState(status: true)
        goOnline()
    }
    
    

        let msg = XMPPMessage(type: "chat", to: senderJID)
        
        msg?.addBody(message)
        self.xmppStream.addDelegate(self, delegateQueue: DispatchQueue.main)
        
        self.xmppStream.send(msg)
        
        
    }
    
