Adds the contact with the specified JID to the user's roster.

Namespace: S22.Xmpp.Client
Assembly: S22.Xmpp (in S22.Xmpp.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

C#
public void AddContact(
	Jid jid,
	string name = null,
	params string[] groups
)

Parameters

jid
Type: S22.Xmpp..::..Jid
The JID of the contact to add to the user's roster.
name (Optional)
Type: System..::..String
The nickname with which to associate the contact.
groups
Type: array<System..::..String>[]()[][]
An array of groups or categories the new contact will be added to.

Remarks

This method creates a new item on the user's roster and requests a subscription from the contact with the specified JID.

Exceptions

ExceptionCondition
System..::..ArgumentNullExceptionThe jid parameter is null.
System.IO..::..IOExceptionThere was a failure while writing to or reading from the network.
System..::..InvalidOperationExceptionThe XmppClient instance is not connected to a remote host, or the XmppClient instance has not authenticated with the XMPP server.
System..::..ObjectDisposedExceptionThe XmppClient object has been disposed.
S22.Xmpp..::..XmppErrorExceptionThe server returned an XMPP error code. Use the Error property of the XmppErrorException to obtain the specific error condition.
S22.Xmpp..::..XmppExceptionThe server returned invalid data or another unspecified XMPP error occurred.

See Also