»

editfriends

editfriends — Add, edit, or delete friends from the user's friends list.

Mode Description

Add, edit, or delete friends from the user's friends list.

Arguments

mode

The protocol request mode: editfriends

user

Username. Leading and trailing whitespace is ignored, as is case.

auth_method

The authentication method used for this request. Default is 'clear', for plain-text authentication. 'cookie' or any of the challenge / response methods are also acceptable.

password

DEPRECATED. Password in plain-text. For the default authentication method, either this needs to be sent, or hpassword.

hpassword

DEPRECATED. Alternative to plain-text password. Password as an MD5 hex digest. Not perfectly secure, but defeats the most simple of network sniffers.

auth_challenge

If using challenge / response authentication, this should be the challenge that was generated for your client.

auth_response

If using challenge / response authentication, this should be the response hash you generate based on the challenge's formula.

ver

(Optional) Protocol version supported by the client; assumed to be 0 if not specified. See Chapter 11: Protocol Versions for details on the protocol version.

editfriend_delete_user

Sending a variable of this form removes the friend user from the user's friend list. It is not an error to delete an already non-existant friend. The value should just be 1.

editfriend_add_i_user

To add a friend, send a variable of this form, where i is any unique integer. The value is the username of the friend to add.

editfriend_add_i_fg

(Optional) Sets the text color of the friend i being added. This value is a HTML-style hex-triplet, and must either be of the form #rrggbb or not sent at all. By default, the value assumed is #000000, black.

editfriend_add_i_bg

(Optional) Sets the background color of the friend i being added. This value is a HTML-style hex-triplet, and must either be of the form #rrggbb or not sent at all. By default, the value assumed is #FFFFFF, white.

editfriend_add_i_groupmask

(Optional) Sets this user's groupmask. Only use this in clients if you've very recently loaded the friend groups. If your client has been loaded on the end user's desktop for days and you haven't loaded friend groups since it started, they may be inaccurate if they've modified their friend groups through the website or another client. In general, don't use this key unless you know what you're doing.

Return Values

success

OK on success or FAIL when there's an error. When there's an error, see errmsg for the error text. The absence of this variable should also be considered an error.

errmsg

The error message if success was FAIL, not present if OK. If the success variable isn't present, this variable most likely won't be either (in the case of a server error), and clients should just report "Server Error, try again later.".

friends_added

The number of friends that were added with this transaction. The records returned indicate which friends were added, along with their names, named using a 1-based index. (from 1 .. friends_added)

friend_n_user

The username of the nth friend that was added.

friend_n_name

The name of the nth friend that was added.