Add Method

This method will add an entity to this entity's roster.

Syntax

ANSI (Cross Platform)
int Add(const char* lpszJabberId, const char* lpszName, const char* lpszGroups);

Unicode (Windows)
INT Add(LPCWSTR lpszJabberId, LPCWSTR lpszName, LPCWSTR lpszGroups);
- (void)add:(NSString*)jabberId :(NSString*)name :(NSString*)groups;
#define MID_XMPP_ADD 2

IPWORKSMQ_EXTERNAL int IPWORKSMQ_CALL IPWorksMQ_XMPP_Do(void *lpObj, int methid, int cparam, void *param[], int cbparam[], int64 *lpllVal);

Remarks

JabberId is the Jabber ID of the entity to be added. It should be of form "user@host". If no hostname is specified, the class will assume the user's account is with the server in IMServer, and will append that hostname to JabberId before sending the request.

Name will contain the name that is to be associated with JabberId in this entity's roster. It may be the empty string, "".

Groups is either the empty string ("") or a comma- separated list of groups to which JabberId is to be added. If JabberId already exists in the buddy list, it will be updated to exist only in the specified groups. A buddy's group list can also be modified by the Buddies property.

The Add method will make a subscription request to the presence of the specified JabberId. Upon receiving this request, the server will add an entry into this user's buddy list with a subscription of type subscriptionNone (0) if there was no previous entry (if this user has already allowed JabberId to subscribe to this user's presence, there will already be an entry of type subscriptionFrom (2)). If the contact chooses to allow the subscription, the server will update the entry and a BuddyUpdate event will fire with the new subscription value (subscriptionTo (1) if this is a new contact, or subscriptionBoth (3) if the contact is now mutual).

The XMPP protocol permits XMPP (Jabber) clients to communicate with foreign IM networks such as AIM, MSN, SMS, and others through the use of gateway servers that translate between the foreign protocol and XMPP. When sending or receiving presence information, messages, or subscription requests, Domain will be a gateway for the foreign network on which the contact resides and with which this user has registered an account for that foreign network. The Register method can be used to register with a foreign network gateway.

Error Handling (C++)

This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks MQ 2020 C++ Edition - Version 20.0 [Build 8155]