agsXMPP.XmppClientConnection.OnRosterIQ C# (CSharp) Method

OnRosterIQ() private method

private OnRosterIQ ( agsXMPP.protocol.client.IQ iq ) : void
iq agsXMPP.protocol.client.IQ
return void
		private void OnRosterIQ(IQ iq)
		{			
			// if type == result then it must be the "FullRoster" we requested
			// in this case we raise OnRosterStart and OnRosterEnd
			// 
			// if type == set its a new added r updated rosteritem. Here we dont raise
			// OnRosterStart and OnRosterEnd
			if (iq.Type == IqType.result && OnRosterStart != null)
				OnRosterStart(this);

			Roster r = iq.Query as Roster;
			if (r != null)
			{
				foreach (RosterItem i in r.GetRoster())
				{
					if (OnRosterItem != null)
						OnRosterItem(this, i);
				}
			}

            if (iq.Type == IqType.result && OnRosterEnd != null)            
                OnRosterEnd(this);
            
            if (m_AutoPresence && iq.Type == IqType.result)
                SendMyPresence();
		}
		#endregion