Sat, 12 Jun 2004 15:13:29 +0000
[gaim-migrate @ 10069]
" - Added keepalive support
- Improved handling of character sets in RTF (improves
intl interoperability between Gaim and the
Windows/XPLAT Messenger clients)." --Mike Stoddard of Novell
committer: Luke Schierer <lschiere@pidgin.im>
| 8675 | 1 | /* |
| 2 | * nmuser.h | |
| 3 | * | |
|
8933
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
4 | * Copyright (c) 2004 Novell, Inc. All Rights Reserved. |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
5 | * |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
6 | * This program is free software; you can redistribute it and/or modify |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
7 | * it under the terms of the GNU General Public License as published by |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
8 | * the Free Software Foundation; version 2 of the License. |
| 8675 | 9 | * |
|
8933
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
10 | * This program is distributed in the hope that it will be useful, |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
13 | * GNU General Public License for more details. |
|
8684
7ec649752daa
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
14 | * |
|
8933
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
15 | * You should have received a copy of the GNU General Public License |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
16 | * along with this program; if not, write to the Free Software |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 8675 | 18 | * |
| 19 | */ | |
| 20 | ||
| 21 | #ifndef __NM_USER_H__ | |
| 22 | #define __NM_USER_H__ | |
| 23 | ||
| 24 | #include <glib.h> | |
| 25 | #include <stdio.h> | |
| 26 | #include <stdlib.h> | |
| 27 | ||
| 28 | typedef guint32 NMERR_T; | |
| 29 | typedef int NMSTATUS_T; | |
| 30 | ||
| 31 | typedef struct _NMUser NMUser; | |
| 32 | ||
| 33 | typedef enum | |
| 34 | { | |
| 35 | NMREQUEST_TYPE_LOGIN = 0, | |
| 36 | NMREQUEST_TYPE_LOGOUT, | |
| 37 | NMREQUEST_TYPE_SETSTATUS, | |
| 38 | NMREQUEST_TYPE_GETDETAILS, | |
| 39 | NMREQUEST_TYPE_CREATECONF, | |
| 40 | NMREQUEST_TYPE_SENDMESSAGE, | |
| 41 | NMREQUEST_TYPE_JOINCONF, | |
| 42 | NMREQUEST_TYPE_LEAVECONF, | |
| 43 | NMREQUEST_TYPE_REJECTCONF, | |
| 44 | NMREQUEST_TYPE_SENDTYPING, | |
| 45 | NMREQUEST_TYPE_CREATECONTACT, | |
| 46 | NMREQUEST_TYPE_DELETECONTACT | |
| 47 | ||
| 48 | } NMRequestType; | |
| 49 | ||
| 50 | #include "debug.h" | |
| 51 | #include "nmmessage.h" | |
| 52 | #include "nmconference.h" | |
| 53 | #include "nmcontact.h" | |
| 54 | #include "nmuserrecord.h" | |
| 55 | #include "nmfield.h" | |
| 56 | #include "nmevent.h" | |
| 57 | ||
| 58 | /* Callback typedefs */ | |
| 59 | typedef void (*nm_response_cb) (NMUser * user, NMERR_T ret_code, | |
| 60 | gpointer resp_data, gpointer user_data); | |
| 61 | ||
| 62 | typedef void (*nm_event_cb) (NMUser * user, NMEvent * event); | |
| 63 | ||
| 64 | #include "nmrequest.h" | |
| 65 | #include "nmconn.h" | |
| 66 | ||
| 67 | /* This represents user that we are currently logged in as */ | |
| 68 | struct _NMUser | |
| 69 | { | |
| 70 | ||
| 71 | char *name; | |
| 72 | ||
| 73 | NMSTATUS_T status; | |
| 74 | ||
| 75 | /* A copy of the login response fields */ | |
| 76 | NMField *fields; | |
| 77 | ||
| 78 | /* The user record for this user */ | |
| 79 | NMUserRecord *user_record; | |
| 80 | ||
| 81 | /* Our connection information */ | |
| 82 | NMConn *conn; | |
| 83 | ||
| 84 | /* Our public IP address */ | |
| 85 | char *address; | |
| 86 | ||
| 87 | /* This is the contact list */ | |
| 88 | NMFolder *root_folder; | |
| 89 | ||
| 90 | /* All contacts that we know about hashed by dn */ | |
| 91 | GHashTable *contacts; | |
| 92 | ||
| 93 | /* All user records hashed by dn */ | |
| 94 | GHashTable *user_records; | |
| 95 | ||
| 96 | /* DN lookup */ | |
| 97 | GHashTable *display_id_to_dn; | |
| 98 | ||
| 99 | /* One on one conversations indexed by recipient's dn */ | |
| 100 | GSList *conferences; | |
| 101 | ||
| 102 | guint32 conference_count; | |
| 103 | ||
| 104 | /* Called when we receive an event */ | |
| 105 | nm_event_cb evt_callback; | |
| 106 | ||
|
8933
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
107 | /* Privacy settings */ |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
108 | gboolean privacy_locked; |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
109 | gboolean default_deny; |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
110 | GSList *allow_list; |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
111 | GSList *deny_list; |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
112 | |
| 8675 | 113 | /* Pending requests. If we need to go to the server to more info |
| 114 | * before processing a request we will queue it up and process when | |
| 115 | * we get a response | |
| 116 | */ | |
| 117 | GSList *pending_requests; | |
| 118 | ||
| 119 | /* Pending events. Same as above except for events. */ | |
| 120 | GSList *pending_events; | |
| 121 | ||
| 122 | /* Generic pointer to data needed by the client | |
| 123 | * using the API | |
| 124 | */ | |
| 125 | gpointer client_data; | |
| 126 | ||
|
9268
196cbf2cae4c
[gaim-migrate @ 10069]
Mike Stoddard <mistoddard@novell.com>
parents:
8933
diff
changeset
|
127 | /* Have the privacy lists been synched yet */ |
|
196cbf2cae4c
[gaim-migrate @ 10069]
Mike Stoddard <mistoddard@novell.com>
parents:
8933
diff
changeset
|
128 | gboolean privacy_synched; |
|
196cbf2cae4c
[gaim-migrate @ 10069]
Mike Stoddard <mistoddard@novell.com>
parents:
8933
diff
changeset
|
129 | |
| 8675 | 130 | }; |
| 131 | ||
| 132 | #define NM_STATUS_UNKNOWN 0 | |
| 133 | #define NM_STATUS_OFFLINE 1 | |
| 134 | #define NM_STATUS_AVAILABLE 2 | |
| 135 | #define NM_STATUS_BUSY 3 | |
| 136 | #define NM_STATUS_AWAY 4 | |
| 137 | #define NM_STATUS_AWAY_IDLE 5 | |
| 138 | #define NM_STATUS_INVALID 6 | |
| 139 | ||
| 140 | #define NMERR_BASE 0x2000L | |
| 141 | #define NM_OK 0L | |
| 142 | #define NMERR_BAD_PARM (NMERR_BASE + 0x0001) | |
| 143 | #define NMERR_TCP_WRITE (NMERR_BASE + 0x0002) | |
| 144 | #define NMERR_TCP_READ (NMERR_BASE + 0x0003) | |
| 145 | #define NMERR_PROTOCOL (NMERR_BASE + 0x0004) | |
|
8933
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
146 | #define NMERR_SERVER_REDIRECT (NMERR_BASE + 0x0005) |
| 8675 | 147 | #define NMERR_CONFERENCE_NOT_FOUND (NMERR_BASE + 0x0006) |
| 148 | #define NMERR_CONFERENCE_NOT_INSTANTIATED (NMERR_BASE + 0x0007) | |
| 149 | #define NMERR_FOLDER_EXISTS (NMERR_BASE + 0x0008) | |
| 150 | ||
|
8933
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
151 | /* Errors that are returned from the server */ |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
152 | #define NMERR_SERVER_BASE 0xD100L |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
153 | #define NMERR_ACCESS_DENIED (NMERR_SERVER_BASE + 0x0006) |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
154 | #define NMERR_NOT_SUPPORTED (NMERR_SERVER_BASE + 0x000A) |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
155 | #define NMERR_PASSWORD_EXPIRED (NMERR_SERVER_BASE + 0x000B) |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
156 | #define NMERR_PASSWORD_INVALID (NMERR_SERVER_BASE + 0x000C) |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
157 | #define NMERR_USER_NOT_FOUND (NMERR_SERVER_BASE + 0x000D) |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
158 | #define NMERR_USER_DISABLED (NMERR_SERVER_BASE + 0x0010) |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
159 | #define NMERR_DIRECTORY_FAILURE (NMERR_SERVER_BASE + 0x0011) |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
160 | #define NMERR_HOST_NOT_FOUND (NMERR_SERVER_BASE + 0x0019) |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
161 | #define NMERR_ADMIN_LOCKED (NMERR_SERVER_BASE + 0x001C) |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
162 | #define NMERR_DUPLICATE_PARTICIPANT (NMERR_SERVER_BASE + 0x001F) |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
163 | #define NMERR_SERVER_BUSY (NMERR_SERVER_BASE + 0x0023) |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
164 | #define NMERR_OBJECT_NOT_FOUND (NMERR_SERVER_BASE + 0x0024) |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
165 | #define NMERR_DIRECTORY_UPDATE (NMERR_SERVER_BASE + 0x0025) |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
166 | #define NMERR_DUPLICATE_FOLDER (NMERR_SERVER_BASE + 0x0026) |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
167 | #define NMERR_DUPLICATE_CONTACT (NMERR_SERVER_BASE + 0x0027) |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
168 | #define NMERR_USER_NOT_ALLOWED (NMERR_SERVER_BASE + 0x0028) |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
169 | #define NMERR_TOO_MANY_CONTACTS (NMERR_SERVER_BASE + 0x0029) |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
170 | #define NMERR_CONFERENCE_NOT_FOUND_2 (NMERR_SERVER_BASE + 0x002B) |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
171 | #define NMERR_TOO_MANY_FOLDERS (NMERR_SERVER_BASE + 0x002C) |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
172 | #define NMERR_SERVER_PROTOCOL (NMERR_SERVER_BASE + 0x0030) |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
173 | #define NMERR_CONVERSATION_INVITE (NMERR_SERVER_BASE + 0x0035) |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
174 | #define NMERR_USER_BLOCKED (NMERR_SERVER_BASE + 0x0039) |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
175 | #define NMERR_MASTER_ARCHIVE_MISSING (NMERR_SERVER_BASE + 0x003A) |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
176 | #define NMERR_PASSWORD_EXPIRED_2 (NMERR_SERVER_BASE + 0x0042) |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
177 | #define NMERR_CREDENTIALS_MISSING (NMERR_SERVER_BASE + 0x0046) |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
178 | #define NMERR_AUTHENTICATION_FAILED (NMERR_SERVER_BASE + 0x0049) |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
179 | #define NMERR_EVAL_CONNECTION_LIMIT (NMERR_SERVER_BASE + 0x004A) |
| 8675 | 180 | |
|
8684
7ec649752daa
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
181 | /** |
| 8675 | 182 | * Initialize the user that we are going to login to the system as. |
| 183 | * | |
| 184 | * @param name The userid of the user | |
| 185 | * @param server IP Address of server | |
| 186 | * @param port Port to connect to on the server | |
| 187 | * @param data Client data to associate with the user | |
|
8735
01248ea222d3
[gaim-migrate @ 9490]
Jonathan Champ <royanee@users.sourceforge.net>
parents:
8684
diff
changeset
|
188 | * @param event_callback Function to call when we receive an event |
| 8675 | 189 | * |
| 190 | * @return The initialized user object. Must be freed by calling | |
| 191 | * nm_deinitialize_user | |
| 192 | */ | |
| 193 | NMUser *nm_initialize_user(const char *name, const char *server, int port, | |
| 194 | gpointer data, nm_event_cb event_callback); | |
| 195 | ||
| 196 | ||
|
8684
7ec649752daa
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
197 | /** |
| 8675 | 198 | * Free up resources associated with the user object. |
| 199 | * | |
| 200 | * @param user The user to deinitialize | |
| 201 | */ | |
| 202 | void nm_deinitialize_user(NMUser * user); | |
| 203 | ||
|
8684
7ec649752daa
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
204 | /** |
| 8675 | 205 | * Send a login request to the server. |
| 206 | * | |
| 207 | * The response data sent to the callback will be NULL. | |
| 208 | * | |
| 209 | * @param user The User to login -- must be initialized | |
| 210 | * @param pwd The password of the user | |
| 211 | * @param my_addr The address of the client machine | |
| 212 | * @param user_agent String describing the client (eg. "Gaim/0.76 (Linux; 2.4.20)") | |
| 213 | * @param callback Function to call when we get the response from the server | |
| 214 | * @param data User defined data to be passed to the callback function | |
|
8684
7ec649752daa
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
215 | * |
| 8675 | 216 | * |
| 217 | * @return NM_OK if login is sent successfully, error otherwise. | |
| 218 | */ | |
| 219 | NMERR_T nm_send_login(NMUser * user, const char *pwd, const char *my_addr, | |
| 220 | const char *user_agent, nm_response_cb callback, | |
| 221 | gpointer data); | |
| 222 | ||
|
8684
7ec649752daa
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
223 | /** |
| 8675 | 224 | * Send a set status request to the server. |
| 225 | * | |
| 226 | * The response data sent to the callback will be NULL. | |
| 227 | * | |
| 228 | * @param user The logged in User | |
| 229 | * @param dn The DN of the user (if known, or NULL if not known) | |
| 230 | * @param address IP Address of server | |
| 231 | * @param callback Function to call when we get the response from the server | |
| 232 | * | |
| 233 | * | |
| 234 | * @return NM_OK if successfully sent, error otherwise | |
| 235 | */ | |
| 236 | NMERR_T nm_send_set_status(NMUser * user, int status, const char *text, | |
| 237 | const char *auto_resp, nm_response_cb callback, | |
| 238 | gpointer data); | |
| 239 | ||
|
8684
7ec649752daa
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
240 | /** |
| 8675 | 241 | * Send a create conference to the server. |
| 242 | * | |
| 243 | * The response data sent to the callback will be NULL. | |
| 244 | * | |
|
8933
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
245 | * @param user The logged in User |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
246 | * @param conference Conference to create |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
247 | * @param add_participants Add participant list on create? |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
248 | * @param callback Function to call when we get the response from the server |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
249 | * @param data User defined data to be passed to the callback function |
| 8675 | 250 | * |
| 251 | * @return NM_OK if successfully sent, error otherwise | |
| 252 | */ | |
| 253 | NMERR_T nm_send_create_conference(NMUser * user, NMConference * conference, | |
| 254 | nm_response_cb callback, gpointer data); | |
| 255 | ||
|
8684
7ec649752daa
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
256 | /** |
| 8675 | 257 | * Tell server we have left the conference. |
|
8684
7ec649752daa
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
258 | * |
| 8675 | 259 | * The response data sent to the callback will be NULL. |
| 260 | * | |
| 261 | * @param user The logged in User | |
| 262 | * @param conference Conference the user is leaving | |
| 263 | * @param callback Function to call when we get the response from the server | |
| 264 | * @param data User defined data to be passed to the callback function | |
| 265 | * | |
| 266 | * @return NM_OK if successfully sent, error otherwise | |
| 267 | */ | |
| 268 | NMERR_T nm_send_leave_conference(NMUser * user, NMConference * conference, | |
| 269 | nm_response_cb callback, gpointer data); | |
| 270 | ||
|
8684
7ec649752daa
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
271 | /** |
| 8675 | 272 | * Send a join conference request to the server. |
| 273 | * | |
| 274 | * The response data sent to the callback will be NULL. | |
| 275 | * | |
| 276 | * @param user The logged in User | |
| 277 | * @param conference Conference the user is joining | |
| 278 | * @param callback Function to call when we get the response from the server | |
| 279 | * @param data User defined data to be passed to the callback function | |
| 280 | * | |
| 281 | * | |
| 282 | * @return NM_OK if successfully sent, error otherwise | |
| 283 | */ | |
| 284 | NMERR_T nm_send_join_conference(NMUser * user, NMConference * conference, | |
| 285 | nm_response_cb callback, gpointer data); | |
| 286 | ||
|
8684
7ec649752daa
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
287 | /** |
| 8675 | 288 | * Send a conference reject request to the server. |
| 289 | * | |
|
8684
7ec649752daa
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
290 | * The response data sent to the callback will be NULL. |
| 8675 | 291 | * |
| 292 | * @param user The logged in User | |
| 293 | * @param conference Conference the user is rejecting | |
| 294 | * @param callback Function to call when we get the response from the server | |
| 295 | * @param data User defined data to be passed to the callback function | |
| 296 | * | |
| 297 | * | |
| 298 | * @return NM_OK if successfully sent, error otherwise | |
| 299 | */ | |
| 300 | NMERR_T nm_send_reject_conference(NMUser * user, NMConference * conference, | |
| 301 | nm_response_cb callback, gpointer data); | |
| 302 | ||
|
8933
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
303 | |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
304 | /** |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
305 | * Send a conference invitation to the server. |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
306 | * |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
307 | * The response data sent to the callback will be NULL. |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
308 | * |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
309 | * @param user The logged in User |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
310 | * @param conference Conference the user is rejecting |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
311 | * @param user_record The user to invite |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
312 | * @param message The invite message if there is one, NULL otherwise |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
313 | * @param callback Function to call when we get the response from the server |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
314 | * @param data User defined data to be passed to the callback function |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
315 | * |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
316 | * |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
317 | * @return NM_OK if successfully sent, error otherwise |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
318 | */ |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
319 | NMERR_T nm_send_conference_invite(NMUser *user, NMConference *conference, NMUserRecord *user_record, |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
320 | const char *message, nm_response_cb callback, gpointer data); |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
321 | |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
322 | /** |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
323 | * Get details for a more than one user from the server. |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
324 | * |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
325 | * The response data sent to the callback will be an NMUserRecord which should be |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
326 | * freed with nm_release_user_record |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
327 | * |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
328 | * @param user The logged in User |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
329 | * @param names Link list of user id's or dn's |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
330 | * @param callback Function to call when we get the response from the server |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
331 | * @param data User defined data to be passed to the callback function |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
332 | * |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
333 | * @return NM_OK if successfully sent, error otherwise |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
334 | */ |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
335 | NMERR_T nm_send_multiple_get_details(NMUser * user, GSList *names, |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
336 | nm_response_cb callback, gpointer data); |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
337 | |
|
8684
7ec649752daa
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
338 | /** |
| 8675 | 339 | * Get details for a user from the server. |
|
8684
7ec649752daa
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
340 | * |
| 8675 | 341 | * The response data sent to the callback will be an NMUserRecord which should be |
| 342 | * freed with nm_release_user_record | |
| 343 | * | |
| 344 | * @param user The logged in User | |
| 345 | * @param name Userid or DN of the user to look up | |
| 346 | * @param callback Function to call when we get the response from the server | |
| 347 | * @param data User defined data to be passed to the callback function | |
| 348 | * | |
| 349 | * @return NM_OK if successfully sent, error otherwise | |
| 350 | */ | |
| 351 | NMERR_T nm_send_get_details(NMUser * user, const char *name, | |
| 352 | nm_response_cb callback, gpointer data); | |
| 353 | ||
|
8684
7ec649752daa
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
354 | /** |
| 8675 | 355 | * Send a message. |
| 356 | * | |
| 357 | * The response data sent to the callback will be NULL. | |
| 358 | * | |
| 359 | * @param user The logged in User | |
| 360 | * @param message The message to send. | |
| 361 | * @param callback Function to call when we get the response from the server | |
| 362 | * | |
| 363 | * @return NM_OK if successfully sent, error otherwise | |
| 364 | */ | |
| 365 | NMERR_T nm_send_message(NMUser * user, NMMessage * message, | |
| 366 | nm_response_cb callback); | |
| 367 | ||
|
8684
7ec649752daa
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
368 | /** |
| 8675 | 369 | * Sends a typing event to the server. |
| 370 | * | |
| 371 | * The response data sent to the callback will be NULL. | |
| 372 | * | |
| 373 | * @param user The logged in User | |
| 374 | * @param conf The conference that corresponds to the typing event | |
| 375 | * @param typing TRUE if the user is typing | |
| 376 | * FALSE if the user has stopped typing | |
| 377 | * @param callback Function to call when we get the response from the server | |
| 378 | * | |
| 379 | * @return NM_OK if successfully sent, error otherwise | |
| 380 | */ | |
| 381 | NMERR_T nm_send_typing(NMUser * user, NMConference * conf, | |
| 382 | gboolean typing, nm_response_cb callback); | |
| 383 | ||
|
8684
7ec649752daa
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
384 | /** |
| 8675 | 385 | * Send a create contact request to the server. |
| 386 | * | |
| 387 | * The given folder should already exist on the server. If not, | |
| 388 | * the call will fail. | |
| 389 | * | |
| 390 | * The response data sent to the callback will be a NMContact which should | |
| 391 | * be released with nm_release_contact | |
| 392 | * | |
| 393 | * @param user The logged in User | |
| 394 | * @param folder The folder that the contact should be created in | |
| 395 | * @param contact The contact to add | |
| 396 | * @param callback Function to call when we get the response from the server | |
| 397 | * @param data User defined data | |
| 398 | * | |
| 399 | * @return NM_OK if successfully sent, error otherwise | |
| 400 | */ | |
| 401 | NMERR_T nm_send_create_contact(NMUser * user, NMFolder * folder, | |
| 402 | NMContact * contact, nm_response_cb callback, | |
| 403 | gpointer data); | |
| 404 | ||
|
8684
7ec649752daa
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
405 | /** |
| 8675 | 406 | * Send a remove contact request to the server. |
| 407 | * | |
| 408 | * The response data sent to the callback will be NULL. | |
| 409 | * | |
| 410 | * @param user The logged in User | |
| 411 | * @param folder The folder to remove contact from | |
| 412 | * @param contact The contact to remove | |
| 413 | * @param callback Function to call when we get the response from the server | |
| 414 | * @param data User defined data | |
| 415 | * | |
| 416 | * @return NM_OK if successfully sent, error otherwise | |
| 417 | */ | |
| 418 | NMERR_T nm_send_remove_contact(NMUser * user, NMFolder * folder, | |
| 419 | NMContact * contact, nm_response_cb callback, | |
| 420 | gpointer data); | |
| 421 | ||
|
8684
7ec649752daa
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
422 | /** |
| 8675 | 423 | * Send a create folder request to the server. |
| 424 | * | |
| 425 | * The response data sent to the callback will be a NMFolder which should be | |
| 426 | * released with nm_release_folder | |
| 427 | * | |
| 428 | * @param user The logged in User | |
| 429 | * @param name The name of the folder to create | |
| 430 | * @param callback Function to call when we get the response from the server | |
| 431 | * @param data User defined data | |
| 432 | * | |
| 433 | * @return NM_OK if successfully sent, error otherwise | |
| 434 | */ | |
| 435 | NMERR_T nm_send_create_folder(NMUser * user, const char *name, | |
| 436 | nm_response_cb callback, gpointer data); | |
| 437 | ||
|
8684
7ec649752daa
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
438 | /** |
| 8675 | 439 | * Send a delete folder request to the server. |
| 440 | * | |
| 441 | * The response data sent to the callback will be NULL. | |
| 442 | * | |
| 443 | * @param user The logged in User | |
| 444 | * @param folder The name of the folder to remove | |
| 445 | * @param callback Function to call when we get the response from the server | |
| 446 | * @param data User defined data | |
| 447 | * | |
| 448 | * @return NM_OK if successfully sent, error otherwise | |
| 449 | */ | |
| 450 | NMERR_T nm_send_remove_folder(NMUser * user, NMFolder * folder, | |
| 451 | nm_response_cb callback, gpointer data); | |
| 452 | ||
|
8684
7ec649752daa
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
453 | /** |
| 8675 | 454 | * Send a rename contact request to the server. |
| 455 | * | |
| 456 | * The response data sent to the callback will be NULL. | |
| 457 | * | |
| 458 | * @param user The logged in User | |
| 459 | * @param contact The contact to rename | |
| 460 | * @param new_name The new display name for the contact | |
| 461 | * @param callback Function to call when we get the response from the server | |
| 462 | * @param data User defined data | |
| 463 | * | |
| 464 | * @return NM_OK if successfully sent, error otherwise | |
| 465 | */ | |
| 466 | NMERR_T nm_send_rename_contact(NMUser * user, NMContact * contact, | |
| 467 | const char *new_name, nm_response_cb callback, | |
| 468 | gpointer data); | |
| 469 | ||
|
8684
7ec649752daa
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
470 | /** |
| 8675 | 471 | * Send a rename folder request to the server. |
| 472 | * | |
| 473 | * The response data sent to the callback will be NULL. | |
| 474 | * | |
| 475 | * @param user The logged in User | |
| 476 | * @param folder The folder to rename | |
| 477 | * @param new_name The new name of the folder | |
| 478 | * @param callback Function to call when we get the response from the server | |
| 479 | * @param data User defined data | |
| 480 | * | |
| 481 | * @return NM_OK if successfully sent, error otherwise | |
| 482 | */ | |
| 483 | NMERR_T nm_send_rename_folder(NMUser * user, NMFolder * folder, | |
| 484 | const char *new_name, nm_response_cb callback, | |
| 485 | gpointer data); | |
| 486 | ||
|
8684
7ec649752daa
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
487 | /** |
| 8675 | 488 | * Send a move contact request to the server. |
| 489 | * | |
| 490 | * The response data sent to the callback will be NULL. | |
| 491 | * | |
| 492 | * @param user The logged in User | |
| 493 | * @param contact The contact to move | |
| 494 | * @param folder The folder to move the contact to | |
| 495 | * @param callback Function to call when we get the response from the server | |
| 496 | * @param data User defined data | |
| 497 | * | |
| 498 | * @return NM_OK if successfully sent, error otherwise | |
| 499 | */ | |
| 500 | NMERR_T nm_send_move_contact(NMUser * user, NMContact * contact, | |
| 501 | NMFolder * folder, nm_response_cb callback, | |
| 502 | gpointer data); | |
| 503 | ||
|
8684
7ec649752daa
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
504 | /** |
| 8675 | 505 | * Send a get status request to the server. |
| 506 | * | |
| 507 | * The response data sent to the callback will be a NMUserRecord. | |
| 508 | * | |
| 509 | * @param user The logged in User | |
| 510 | * @param contact The contact to move | |
| 511 | * @param folder The folder to move the contact to | |
| 512 | * @param callback Function to call when we get the response from the server | |
| 513 | * @param data User defined data | |
| 514 | * | |
| 515 | * @return NM_OK if successfully sent, error otherwise | |
| 516 | */ | |
| 517 | NMERR_T nm_send_get_status(NMUser * user, NMUserRecord * user_record, | |
| 518 | nm_response_cb callback, gpointer data); | |
| 519 | ||
|
8684
7ec649752daa
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
520 | /** |
|
8933
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
521 | * Send a request to add an item to the allow or deny list. |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
522 | * |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
523 | * @param user The logged in User |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
524 | * @param who The userid or DN of the user to add to list |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
525 | * @param allow_list TRUE if adding to allow list, FALSE if adding to deny list |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
526 | * @param callback Function to call when we get the response from the server |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
527 | * @param data User defined data |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
528 | * |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
529 | * @return NM_OK if successfully sent, error otherwise |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
530 | */ |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
531 | NMERR_T |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
532 | nm_send_create_privacy_item(NMUser *user, const char *who, gboolean is_allowed, |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
533 | nm_response_cb callback, gpointer data); |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
534 | |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
535 | /** |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
536 | * Send a request to remove an item from the allow or deny list. |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
537 | * |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
538 | * @param user The logged in User |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
539 | * @param who The userid or DN of the user to add to list |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
540 | * @param allow_list TRUE if removing from allow list, FALSE if removing from deny list |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
541 | * @param callback Function to call when we get the response from the server |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
542 | * @param data User defined data |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
543 | * |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
544 | * @return NM_OK if successfully sent, error otherwise |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
545 | */ |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
546 | NMERR_T |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
547 | nm_send_remove_privacy_item(NMUser *user, const char *dn, gboolean allow_list, |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
548 | nm_response_cb callback, gpointer data); |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
549 | |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
550 | /** |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
551 | * Send a request to change the default privacy setting to deny all or allow all |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
552 | * |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
553 | * @param user The logged in User |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
554 | * @param default_deny TRUE if default should be changed to deny all |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
555 | * @param callback Function to call when we get the response from the server |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
556 | * @param data User defined data |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
557 | * |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
558 | * @return NM_OK if successfully sent, error otherwise |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
559 | */ |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
560 | NMERR_T |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
561 | nm_send_set_privacy_default(NMUser *user, gboolean default_deny, |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
562 | nm_response_cb callback, gpointer data); |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
563 | |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
564 | /** |
|
9268
196cbf2cae4c
[gaim-migrate @ 10069]
Mike Stoddard <mistoddard@novell.com>
parents:
8933
diff
changeset
|
565 | * Send a ping to the server |
|
196cbf2cae4c
[gaim-migrate @ 10069]
Mike Stoddard <mistoddard@novell.com>
parents:
8933
diff
changeset
|
566 | * |
|
196cbf2cae4c
[gaim-migrate @ 10069]
Mike Stoddard <mistoddard@novell.com>
parents:
8933
diff
changeset
|
567 | * @param user The logged in User |
|
196cbf2cae4c
[gaim-migrate @ 10069]
Mike Stoddard <mistoddard@novell.com>
parents:
8933
diff
changeset
|
568 | * @param callback Function to call when we get the response from the server |
|
196cbf2cae4c
[gaim-migrate @ 10069]
Mike Stoddard <mistoddard@novell.com>
parents:
8933
diff
changeset
|
569 | * @param data User defined data |
|
196cbf2cae4c
[gaim-migrate @ 10069]
Mike Stoddard <mistoddard@novell.com>
parents:
8933
diff
changeset
|
570 | * |
|
196cbf2cae4c
[gaim-migrate @ 10069]
Mike Stoddard <mistoddard@novell.com>
parents:
8933
diff
changeset
|
571 | * @return NM_OK if successfully sent, error otherwise |
|
196cbf2cae4c
[gaim-migrate @ 10069]
Mike Stoddard <mistoddard@novell.com>
parents:
8933
diff
changeset
|
572 | */ |
|
196cbf2cae4c
[gaim-migrate @ 10069]
Mike Stoddard <mistoddard@novell.com>
parents:
8933
diff
changeset
|
573 | NMERR_T |
|
196cbf2cae4c
[gaim-migrate @ 10069]
Mike Stoddard <mistoddard@novell.com>
parents:
8933
diff
changeset
|
574 | nm_send_keepalive(NMUser *user, nm_response_cb callback, gpointer data); |
|
196cbf2cae4c
[gaim-migrate @ 10069]
Mike Stoddard <mistoddard@novell.com>
parents:
8933
diff
changeset
|
575 | |
|
196cbf2cae4c
[gaim-migrate @ 10069]
Mike Stoddard <mistoddard@novell.com>
parents:
8933
diff
changeset
|
576 | /** |
| 8675 | 577 | * Reads a response/event from the server and processes it. |
| 578 | * | |
| 579 | * @param user The logged in User | |
| 580 | */ | |
| 581 | NMERR_T nm_process_new_data(NMUser * user); | |
| 582 | ||
|
8684
7ec649752daa
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
583 | /** |
| 8675 | 584 | * Return the root folder of the contact list |
| 585 | * | |
| 586 | * @param user The logged in User | |
| 587 | * | |
| 588 | * @return Root folder | |
| 589 | */ | |
| 590 | NMFolder *nm_get_root_folder(NMUser * user); | |
| 591 | ||
|
8684
7ec649752daa
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
592 | /** |
| 8675 | 593 | * Create the contact list based on the login fields |
| 594 | * | |
| 595 | * @param user The logged in User | |
| 596 | * | |
| 597 | */ | |
| 598 | NMERR_T nm_create_contact_list(NMUser * user); | |
| 599 | ||
| 600 | void nm_destroy_contact_list(NMUser * user); | |
| 601 | ||
| 602 | void nm_user_add_contact(NMUser * user, NMContact * contact); | |
| 603 | ||
| 604 | void nm_user_add_user_record(NMUser * user, NMUserRecord * user_record); | |
| 605 | ||
| 606 | NMContact *nm_find_contact(NMUser * user, const char *dn); | |
| 607 | ||
| 608 | GList *nm_find_contacts(NMUser * user, const char *dn); | |
| 609 | ||
| 610 | NMUserRecord *nm_find_user_record(NMUser * user, const char *dn); | |
| 611 | ||
| 612 | NMFolder *nm_find_folder(NMUser * user, const char *name); | |
| 613 | ||
| 614 | NMFolder *nm_find_folder_by_id(NMUser * user, int object_id); | |
| 615 | ||
| 616 | NMConference *nm_find_conversation(NMUser * user, const char *who); | |
| 617 | ||
| 618 | void nm_conference_list_add(NMUser * user, NMConference * conf); | |
| 619 | ||
| 620 | void nm_conference_list_remove(NMUser * user, NMConference * conf); | |
| 621 | ||
| 622 | void nm_conference_list_free(NMUser * user); | |
| 623 | ||
| 624 | NMConference *nm_conference_list_find(NMUser * user, const char *guid); | |
| 625 | ||
| 626 | const char *nm_lookup_dn(NMUser * user, const char *display_id); | |
| 627 | ||
| 628 | nm_event_cb nm_user_get_event_callback(NMUser * user); | |
| 629 | ||
| 630 | NMConn *nm_user_get_conn(NMUser * user); | |
| 631 | ||
|
8933
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
632 | gboolean nm_user_is_privacy_locked(NMUser *user); |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
633 | |
| 8675 | 634 | /** Some utility functions **/ |
| 635 | ||
| 636 | /** | |
|
8684
7ec649752daa
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
637 | * Check to see if the conference GUIDs are equivalent. |
| 8675 | 638 | * |
| 639 | * @param guid1 First guid to compare | |
| 640 | * @param guid2 Second guid to compare | |
| 641 | * | |
| 642 | * @return TRUE if conference GUIDs are equivalent, FALSE otherwise. | |
| 643 | * | |
| 644 | */ | |
| 645 | gboolean nm_are_guids_equal(const char *guid1, const char *guid2); | |
| 646 | ||
| 647 | ||
| 648 | /** | |
| 649 | * Case insensitive compare for utf8 strings | |
| 650 | * | |
| 651 | * @param guid1 First string to compare | |
| 652 | * @param guid2 Second string to compare | |
| 653 | * | |
| 654 | * @return -1 if str1 < str2, 0 if str1 = str2, 1 if str1 > str2 | |
| 655 | * | |
| 656 | */ | |
| 657 | gint nm_utf8_strcasecmp(gconstpointer str1, gconstpointer str2); | |
| 658 | ||
| 659 | /** | |
| 660 | * Compare UTF8 strings for equality only (case insensitive) | |
| 661 | * | |
| 662 | * @param guid1 First string to compare | |
| 663 | * @param guid2 Second string to compare | |
| 664 | * | |
| 665 | * @return TRUE if strings are equal, FALSE otherwise | |
| 666 | * | |
| 667 | */ | |
| 668 | gboolean nm_utf8_str_equal(gconstpointer str1, gconstpointer str2); | |
| 669 | ||
| 670 | /** | |
| 671 | * Convert a fully typed LDAP DN to dotted, untype notation | |
| 672 | * e.g. cn=mike,o=novell -> mike.novell | |
| 673 | * | |
| 674 | * @param typed Fully typed dn | |
| 675 | * | |
| 676 | * @return Dotted equivalent of typed (must be freed). | |
| 677 | * | |
| 678 | */ | |
| 679 | char *nm_typed_to_dotted(const char *typed); | |
| 680 | ||
|
8933
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
681 | /** |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
682 | * Return a string representation of the error code. |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
683 | * |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
684 | * @param error NMERR_T to convert to string |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
685 | * |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
686 | * @return String representation. |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
687 | */ |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
688 | const char *nm_error_to_string (NMERR_T err); |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8735
diff
changeset
|
689 | |
| 8675 | 690 | #endif |