Subject: Read Incoming Messages.
Hello Alex,
I am new to agsXMPP and my requirement is to read all the incoming messages using agsXMPP library in my .net application. I tried using the below code, through which i can read the incoming messages for the logged in user.
But as per my requirement i need to read all the incoming messages irrespective of logged in user (like admin user). Is it possible to login as admin user and read all the incoming message? e.g. if user1 sends the message to user2 still i should read the messages as a admin user.
Could you please provide some sample code handle this issue.
Thanks in Advance.
Thanks & Regards,
Sreenivas Kaushik
I am new to agsXMPP and my requirement is to read all the incoming messages using agsXMPP library in my .net application. I tried using the below code, through which i can read the incoming messages for the logged in user.
void OnLogin(object sender)
{
xmppCon.Server = "abc.com";
xmppCon.ConnectServer = "Server Ip";
xmppCon.Port = 5222;
xmppCon.Username = "user3";
xmppCon.Password = "password";
try
{
xmppCon.OnAuthError += new XmppElementHandler(OnAuthError);
xmppCon.OnLogin += new ObjectHandler(OnLogin);
xmppCon.OnMessage += new MessageHandler(OnMessage);
xmppCon.Open();
}
catch (Exception ex)
{
MessageBox.Show(ex.StackTrace);
}
}
private void OnMessage(object sender, agsXMPP.protocol.client.Message msg)
{
var From = msg.From;
var Subject = msg.Body;
var To = msg.To;
}
{
xmppCon.Server = "abc.com";
xmppCon.ConnectServer = "Server Ip";
xmppCon.Port = 5222;
xmppCon.Username = "user3";
xmppCon.Password = "password";
try
{
xmppCon.OnAuthError += new XmppElementHandler(OnAuthError);
xmppCon.OnLogin += new ObjectHandler(OnLogin);
xmppCon.OnMessage += new MessageHandler(OnMessage);
xmppCon.Open();
}
catch (Exception ex)
{
MessageBox.Show(ex.StackTrace);
}
}
private void OnMessage(object sender, agsXMPP.protocol.client.Message msg)
{
var From = msg.From;
var Subject = msg.Body;
var To = msg.To;
}
But as per my requirement i need to read all the incoming messages irrespective of logged in user (like admin user). Is it possible to login as admin user and read all the incoming message? e.g. if user1 sends the message to user2 still i should read the messages as a admin user.
Could you please provide some sample code handle this issue.
Thanks in Advance.
Thanks & Regards,
Sreenivas Kaushik