Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
robertpitt #1
Member since Jul 2010 · 7 posts
Group memberships: Members
Show profile · Link to this post
Subject: OnRosterItem / OnPresence for user Status
I need some advice on how to get the user status.

At the moment on login I open my main messenger window.

Each RosterItem is added to a Dictionary and when RosterEnd gets called i inform my MainMessenget to get the update from the Dictionary.

This is ok if i want all contacts including offline.

Is it possible to request the user status so i can check for each Roster so that i do not have to wait for the presence to tell me the state of the contact?
This post was edited on 2010-07-20, 22:26 by robertpitt.
Avatar
Alex #2
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
all contacts are offline by default. You get presence only for contacts which are online.
Quote by robertpitt:
Is it possible to request the user status so i can check for each Roster so that i do not have to wait for the presence to tell me the state of the contact?

no, this is how XMPP works.
This post was edited on 2010-07-20, 22:28 by Alex.
Avatar
robertpitt #3
Member since Jul 2010 · 7 posts
Group memberships: Members
Show profile · Link to this post
This is what i thought, But i do not want to show offline contacts whatsoever.

so by not showing contacts i have a blank ListView until the presence are received.
Avatar
Alex #4
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
or choose a UI control which allows you to hide items.
With WPF this is very easy, with SWF it can be a challenge.
Avatar
robertpitt #5
Member since Jul 2010 · 7 posts
Group memberships: Members
Show profile · Link to this post
im not as confident in WPF as i am with WinForms and to be honest my gui is pretty good and had some good work into it.

im just looking fort new ways to speed up the process from OnLogin to the completed view :/
Avatar
robertpitt #6
Member since Jul 2010 · 7 posts
Group memberships: Members
Show profile · Link to this post
is there not a way i can tell agsXMPP to get the Presences straight away ?
Avatar
Alex #7
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
when the own presence gets sent to the server then the server starts immediately to send out all presences to you. The own presence gets sent after the OnRosterEnd event.
To speed up the process you can use roster versioning and cache the roster in a database. Then the roster will be only requested when it has changed since you last login. But on normal broadband connection with an average roster I see no benefits for roster versioning.

Alex
Avatar
robertpitt #8
Member since Jul 2010 · 7 posts
Group memberships: Members
Show profile · Link to this post
i really do apologise.

When i first made this thread my client was taking 10-30 seconds to get the presences witch im unsure why.

I went threw each possible setting within the XmppClientConnection and set them.

            ClientConnection.Server         = Messenger.Properties.Settings.Default.ChatServer;
            ClientConnection.AutoPresence    = true;
            ClientConnection.AutoRoster       = true;
            ClientConnection.ClientLanguage  = "en";
            ClientConnection.ClientVersion     = Messenger.Properties.Settings.Default.ApplicationVersion;
            ClientConnection.ConnectServer  = Messenger.Properties.Settings.Default.ChatServer;
            ClientConnection.Priority            = +75;
            ClientConnection.Show             = new agsXMPP.protocol.client.ShowType();
            ClientConnection.UseCompression = true;
            ClientConnection.UseSSL            = false;
            ClientConnection.UseStartTLS      = true;

And everything seem to work just fine now, Full Online user list is sent where as before it was sending 5-6 users then 20 seconds later send me 5-6 more.

Everything seems to be ok now.
Avatar
Alex #9
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
this cannot be related to the properties. Maybe the server had problems and was responding slow. Or tracing in your app slowed it down.

Alex
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: agsXMPP RSS