private void xmppClient_OnMessage(object sender, MessageEventArgs e) { var msg = e.Message; Console.WriteLine("OnMessage"); if (msg.IsReceipt) { Console.WriteLine("Got the message receipt for: {0}", msg.Id); if (m_msgClient != null) { m_msgClient.IncomingReceipt(msg.Id); } } else { if (m_msgClient != null) { m_msgClient.IncomingMessage(msg); // Send the acknowledgement var to = msg.From; msg.To = msg.From; msg.From = to; msg.DeliveryReceipt(msg.Id); string status = m_xmppClient.Send(msg); } } }