diff libpurple/protocols/novell/novell.c @ 15823:32c366eeeb99

sed -ie 's/gaim/purple/g'
author Sean Egan <seanegan@gmail.com>
date Mon, 19 Mar 2007 07:01:17 +0000
parents 0b6f337a46d5
children 9e1b2223a5b1
line wrap: on
line diff
--- a/libpurple/protocols/novell/novell.c	Mon Mar 19 06:11:46 2007 +0000
+++ b/libpurple/protocols/novell/novell.c	Mon Mar 19 07:01:17 2007 +0000
@@ -44,7 +44,7 @@
 #define NOVELL_STATUS_TYPE_IDLE "idle"
 #define NOVELL_STATUS_TYPE_APPEAR_OFFLINE "appearoffline"
 
-static GaimPlugin *my_protocol = NULL;
+static PurplePlugin *my_protocol = NULL;
 
 static gboolean
 _is_disconnect_error(NMERR_T err);
@@ -56,16 +56,16 @@
 _send_message(NMUser * user, NMMessage * message);
 
 static void
-_update_buddy_status(NMUser *user, GaimBuddy * buddy, int status, int gmt);
+_update_buddy_status(NMUser *user, PurpleBuddy * buddy, int status, int gmt);
 
 static void
-_remove_gaim_buddies(NMUser * user);
+_remove_purple_buddies(NMUser * user);
 
 static void
-_add_contacts_to_gaim_blist(NMUser * user, NMFolder * folder);
+_add_contacts_to_purple_blist(NMUser * user, NMFolder * folder);
 
 static void
-_add_gaim_buddies(NMUser * user);
+_add_purple_buddies(NMUser * user);
 
 static void
 _sync_contact_list(NMUser *user);
@@ -74,7 +74,7 @@
 _sync_privacy_lists(NMUser *user);
 
 static void
-_show_info(GaimConnection * gc, NMUserRecord * user_record);
+_show_info(PurpleConnection * gc, NMUserRecord * user_record);
 
 const char *
 _get_conference_name(int id);
@@ -88,30 +88,30 @@
 _login_resp_cb(NMUser * user, NMERR_T ret_code,
 			   gpointer resp_data, gpointer user_data)
 {
-	GaimConnection *gc;
+	PurpleConnection *gc;
 	const char *alias;
 	NMERR_T rc;
 
 	if (user == NULL)
 		return;
 
-	gc = gaim_account_get_connection(user->client_data);
+	gc = purple_account_get_connection(user->client_data);
 	if (gc == NULL)
 		return;
 
 	if (ret_code == NM_OK) {
 
 		/* Set alias for user if not set (use Full Name) */
-		alias = gaim_account_get_alias(user->client_data);
+		alias = purple_account_get_alias(user->client_data);
 		if (alias == NULL || *alias == '\0') {
 			alias = nm_user_record_get_full_name(user->user_record);
 
 			if (alias)
-				gaim_account_set_alias(user->client_data, alias);
+				purple_account_set_alias(user->client_data, alias);
 		}
 
-		/* Tell Gaim that we are connected */
-		gaim_connection_set_state(gc, GAIM_CONNECTED);
+		/* Tell Purple that we are connected */
+		purple_connection_set_state(gc, PURPLE_CONNECTED);
 
 		_sync_contact_list(user);
 
@@ -132,7 +132,7 @@
 			ret_code == NMERR_PASSWORD_INVALID) {
 			gc->wants_to_die = TRUE;
 		}
-		gaim_connection_error(gc, err);
+		purple_connection_error(gc, err);
 		g_free(err);
 	}
 }
@@ -142,7 +142,7 @@
 _get_status_resp_cb(NMUser * user, NMERR_T ret_code,
 					gpointer resp_data, gpointer user_data)
 {
-	GaimBuddy *buddy;
+	PurpleBuddy *buddy;
 	GSList *buddies;
 	GSList *bnode;
 	NMUserRecord *user_record = (NMUserRecord *) resp_data;
@@ -153,13 +153,13 @@
 
 	if (ret_code == NM_OK) {
 
-		/* Find all Gaim buddies and update their statuses */
+		/* Find all Purple buddies and update their statuses */
 		const char *name = nm_user_record_get_display_id(user_record);
 
 		if (name) {
-			buddies = gaim_find_buddies((GaimAccount *) user->client_data, name);
+			buddies = purple_find_buddies((PurpleAccount *) user->client_data, name);
 			for (bnode = buddies; bnode; bnode = bnode->next) {
-				buddy = (GaimBuddy *) bnode->data;
+				buddy = (PurpleBuddy *) bnode->data;
 				if (buddy) {
 					status = nm_user_record_get_status(user_record);
 					_update_buddy_status(user, buddy, status, time(0));
@@ -170,7 +170,7 @@
 
 	} else {
 
-		gaim_debug(GAIM_DEBUG_INFO, "novell",
+		purple_debug(PURPLE_DEBUG_INFO, "novell",
 				   "_get_status_resp_cb(): rc = 0x%X\n", ret_code);
 
 	}
@@ -182,7 +182,7 @@
 						gpointer resp_data, gpointer user_data)
 {
 	if (ret_code != NM_OK) {
-		gaim_debug(GAIM_DEBUG_INFO, "novell",
+		purple_debug(PURPLE_DEBUG_INFO, "novell",
 				   "_rename_contact_resp_cb(): rc = 0x%X\n", ret_code);
 	}
 }
@@ -192,8 +192,8 @@
 _get_details_resp_send_msg(NMUser * user, NMERR_T ret_code,
 						   gpointer resp_data, gpointer user_data)
 {
-	GaimConversation *gconv;
-	GaimConnection *gc;
+	PurpleConversation *gconv;
+	PurpleConnection *gc;
 	NMUserRecord *user_record = NULL;
 	NMContact *cntct = NULL;
 	NMConference *conf;
@@ -209,10 +209,10 @@
 		if (user_record) {
 
 			/* Set the title for the conversation */
-			/* XXX - Should this be GAIM_CONV_TYPE_IM? */
-			gconv =	gaim_find_conversation_with_account(GAIM_CONV_TYPE_ANY,
+			/* XXX - Should this be PURPLE_CONV_TYPE_IM? */
+			gconv =	purple_find_conversation_with_account(PURPLE_CONV_TYPE_ANY,
 														nm_user_record_get_display_id(user_record),
-														(GaimAccount *) user->client_data);
+														(PurpleAccount *) user->client_data);
 			if (gconv) {
 
 				dn = nm_user_record_get_dn(user_record);
@@ -221,14 +221,14 @@
 				}
 
 				if (cntct) {
-					gaim_conversation_set_title(gconv,
+					purple_conversation_set_title(gconv,
 												nm_contact_get_display_name(cntct));
 				} else {
 
 					/* Not in the contact list, try to user full name */
 					name = (char *) nm_user_record_get_full_name(user_record);
 					if (name)
-						gaim_conversation_set_title(gconv, name);
+						purple_conversation_set_title(gconv, name);
 				}
 			}
 
@@ -242,13 +242,13 @@
 
 	} else {
 
-		gc = gaim_account_get_connection(user->client_data);
+		gc = purple_account_get_connection(user->client_data);
 		if (gc != NULL) {
 			char *err = g_strdup_printf(_("Unable to send message."
 										  " Could not get details for user (%s)."),
 						    nm_error_to_string (ret_code));
 
-			gaim_notify_error(gc, NULL, err, NULL);
+			purple_notify_error(gc, NULL, err, NULL);
 			g_free(err);
 		}
 
@@ -257,14 +257,14 @@
 	}
 }
 
-/* Set up the new GaimBuddy based on the response from getdetails */
+/* Set up the new PurpleBuddy based on the response from getdetails */
 static void
 _get_details_resp_setup_buddy(NMUser * user, NMERR_T ret_code,
 							  gpointer resp_data, gpointer user_data)
 {
 	NMUserRecord *user_record;
 	NMContact *contact;
-	GaimBuddy *buddy;
+	PurpleBuddy *buddy;
 	const char *alias;
 	NMERR_T rc = NM_OK;
 
@@ -281,12 +281,12 @@
 		nm_contact_set_user_record(contact, user_record);
 
 		/* Set the display id */
-		gaim_blist_rename_buddy(buddy,
+		purple_blist_rename_buddy(buddy,
 								nm_user_record_get_display_id(user_record));
 
-		alias = gaim_buddy_get_alias(buddy);
+		alias = purple_buddy_get_alias(buddy);
 		if (alias == NULL || *alias == '\0' || (strcmp(alias, buddy->name) == 0)) {
-			gaim_blist_alias_buddy(buddy,
+			purple_blist_alias_buddy(buddy,
 								   nm_user_record_get_full_name(user_record));
 
 			/* Tell the server about the new display name */
@@ -310,7 +310,7 @@
 		nm_release_contact(contact);
 }
 
-/* Add the new contact into the GaimBuddy list */
+/* Add the new contact into the PurpleBuddy list */
 static void
 _create_contact_resp_cb(NMUser * user, NMERR_T ret_code,
 						gpointer resp_data, gpointer user_data)
@@ -318,8 +318,8 @@
 	NMContact *tmp_contact = (NMContact *) user_data;
 	NMContact *new_contact = NULL;
 	NMFolder *folder = NULL;
-	GaimGroup *group;
-	GaimBuddy *buddy;
+	PurpleGroup *group;
+	PurpleBuddy *buddy;
 	const char *folder_name = NULL;
 	NMERR_T rc = NM_OK;
 
@@ -343,7 +343,7 @@
 			folder_name = NM_ROOT_FOLDER_NAME;
 
 		/* Re-add the buddy now that we got the okay from the server */
-		if (folder_name && (group = gaim_find_group(folder_name))) {
+		if (folder_name && (group = purple_find_group(folder_name))) {
 
 			const char *alias = nm_contact_get_display_name(tmp_contact);
 			const char *display_id = nm_contact_get_display_id(new_contact);
@@ -364,18 +364,18 @@
 
 			}
 
-			/* Add it to the gaim buddy list if it is not there */
-			buddy = gaim_find_buddy_in_group(user->client_data, display_id, group);
+			/* Add it to the purple buddy list if it is not there */
+			buddy = purple_find_buddy_in_group(user->client_data, display_id, group);
 			if (buddy == NULL) {
-				buddy = gaim_buddy_new(user->client_data, display_id, alias);
-				gaim_blist_add_buddy(buddy, NULL, group, NULL);
+				buddy = purple_buddy_new(user->client_data, display_id, alias);
+				purple_blist_add_buddy(buddy, NULL, group, NULL);
 			}
 
 			/* Save the new buddy as part of the contact object */
 			nm_contact_set_data(new_contact, (gpointer) buddy);
 
 			/* We need details for the user before we can setup the
-			 * new Gaim buddy. We always call this because the
+			 * new Purple buddy. We always call this because the
 			 * 'createcontact' response fields do not always contain
 			 * everything that we need.
 			 */
@@ -388,14 +388,14 @@
 		}
 
 	} else {
-		GaimConnection *gc = gaim_account_get_connection(user->client_data);
+		PurpleConnection *gc = purple_account_get_connection(user->client_data);
 		const char *name = nm_contact_get_dn(tmp_contact);
 		char *err;
 
 		err =
 			g_strdup_printf(_("Unable to add %s to your buddy list (%s)."),
 					name, nm_error_to_string (ret_code));
-		gaim_notify_error(gc, NULL, err, NULL);
+		purple_notify_error(gc, NULL, err, NULL);
 		g_free(err);
 
 	}
@@ -409,19 +409,19 @@
 _send_message_resp_cb(NMUser * user, NMERR_T ret_code,
 					  gpointer resp_data, gpointer user_data)
 {
-	GaimConnection *gc;
+	PurpleConnection *gc;
 	char *err = NULL;
 
 	if (user == NULL)
 		return;
 
 	if (ret_code != NM_OK) {
-		gc = gaim_account_get_connection(user->client_data);
+		gc = purple_account_get_connection(user->client_data);
 
 		/* TODO: Improve this! message to who or for what conference? */
 		err = g_strdup_printf(_("Unable to send message (%s)."),
 				      nm_error_to_string (ret_code));
-		gaim_notify_error(gc, NULL, err, NULL);
+		purple_notify_error(gc, NULL, err, NULL);
 		g_free(err);
 	}
 }
@@ -434,7 +434,7 @@
 	if (ret_code != NM_OK) {
 		/* TODO: Display an error? */
 
-		gaim_debug(GAIM_DEBUG_INFO, "novell",
+		purple_debug(PURPLE_DEBUG_INFO, "novell",
 				   "_remove_contact_resp_cb(): rc = 0x%x\n", ret_code);
 	}
 }
@@ -447,7 +447,7 @@
 	if (ret_code != NM_OK) {
 		/* TODO: Display an error? */
 
-		gaim_debug(GAIM_DEBUG_INFO, "novell",
+		purple_debug(PURPLE_DEBUG_INFO, "novell",
 				   "_remove_folder_resp_cb(): rc = 0x%x\n", ret_code);
 	}
 }
@@ -460,7 +460,7 @@
 	if (ret_code != NM_OK) {
 		/* TODO: Display an error? */
 
-		gaim_debug(GAIM_DEBUG_INFO, "novell",
+		purple_debug(PURPLE_DEBUG_INFO, "novell",
 				   "_move_contact_resp_cb(): rc = 0x%x\n", ret_code);
 	}
 }
@@ -473,7 +473,7 @@
 	if (ret_code != NM_OK) {
 		/* TODO: Display an error? */
 
-		gaim_debug(GAIM_DEBUG_INFO, "novell",
+		purple_debug(PURPLE_DEBUG_INFO, "novell",
 				   "_rename_folder_resp_cb(): rc = 0x%x\n", ret_code);
 	}
 }
@@ -483,18 +483,18 @@
 					gpointer resp_data, gpointer user_data)
 {
 	char *err;
-	GaimConnection *gc;
+	PurpleConnection *gc;
 
 	if (user == NULL)
 		return;
 
 	if (ret_code != NM_OK) {
-		gc = gaim_account_get_connection(user->client_data);
+		gc = purple_account_get_connection(user->client_data);
 		err = g_strdup_printf(_("Unable to invite user (%s)."), nm_error_to_string(ret_code));
-		gaim_notify_error(gc, NULL, err, NULL);
+		purple_notify_error(gc, NULL, err, NULL);
 		g_free(err);
 
-		gaim_debug(GAIM_DEBUG_INFO, "novell",
+		purple_debug(PURPLE_DEBUG_INFO, "novell",
 				   "_sendinvite_resp_cb(): rc = 0x%x\n", ret_code);
 	}
 
@@ -519,7 +519,7 @@
 
 		if ((conf = nm_message_get_conference(msg))) {
 
-			GaimConnection *gc = gaim_account_get_connection(user->client_data);
+			PurpleConnection *gc = purple_account_get_connection(user->client_data);
 			const char *name = NULL;
 			char *err;
 			NMUserRecord *ur;
@@ -538,7 +538,7 @@
 										" Could not create the conference (%s)."),
 						      nm_error_to_string (ret_code));
 
-			gaim_notify_error(gc, NULL, err, NULL);
+			purple_notify_error(gc, NULL, err, NULL);
 			g_free(err);
 		}
 
@@ -580,7 +580,7 @@
 
 		}
 	} else {
-		GaimConnection *gc = gaim_account_get_connection(user->client_data);
+		PurpleConnection *gc = purple_account_get_connection(user->client_data);
 		char *err = g_strdup_printf(_("Unable to move user %s"
 									  " to folder %s in the server side list."
 									  " Error while creating folder (%s)."),
@@ -588,7 +588,7 @@
 					    folder_name,
 					    nm_error_to_string (ret_code));
 
-		gaim_notify_error(gc, NULL, err, NULL);
+		purple_notify_error(gc, NULL, err, NULL);
 		g_free(err);
 	}
 
@@ -626,14 +626,14 @@
 			_check_for_disconnect(user, rc);
 		}
 	} else {
-		GaimConnection *gc = gaim_account_get_connection(user->client_data);
+		PurpleConnection *gc = purple_account_get_connection(user->client_data);
 		const char *name = nm_contact_get_dn(contact);
 		char *err =
 			g_strdup_printf(_("Unable to add %s to your buddy list."
 					  " Error creating folder in server side list (%s)."),
 					name, nm_error_to_string (ret_code));
 
-		gaim_notify_error(gc, NULL, err, NULL);
+		purple_notify_error(gc, NULL, err, NULL);
 
 		nm_release_contact(contact);
 		g_free(err);
@@ -646,8 +646,8 @@
 _join_conf_resp_cb(NMUser * user, NMERR_T ret_code,
 				   gpointer resp_data, gpointer user_data)
 {
-	GaimConversation *chat;
-	GaimConnection *gc;
+	PurpleConversation *chat;
+	PurpleConnection *gc;
 	NMUserRecord *ur;
 	NMConference *conference = user_data;
 	const char *name, *conf_name;
@@ -656,7 +656,7 @@
 	if (user == NULL || conference == NULL)
 		return;
 
-	gc = gaim_account_get_connection(user->client_data);
+	gc = purple_account_get_connection(user->client_data);
 
 	if (ret_code == NM_OK) {
 		conf_name = _get_conference_name(++user->conference_count);
@@ -670,8 +670,8 @@
 				ur = nm_conference_get_participant(conference, i);
 				if (ur) {
 					name = nm_user_record_get_display_id(ur);
-					gaim_conv_chat_add_user(GAIM_CONV_CHAT(chat), name, NULL, 
-											GAIM_CBFLAGS_NONE, TRUE);
+					purple_conv_chat_add_user(PURPLE_CONV_CHAT(chat), name, NULL, 
+											PURPLE_CBFLAGS_NONE, TRUE);
 				}
 			}
 		}
@@ -683,7 +683,7 @@
 _get_details_resp_show_info(NMUser * user, NMERR_T ret_code,
 							gpointer resp_data, gpointer user_data)
 {
-	GaimConnection *gc;
+	PurpleConnection *gc;
 	NMUserRecord *user_record;
 	char *name;
 	char *err;
@@ -696,15 +696,15 @@
 	if (ret_code == NM_OK) {
 		user_record = (NMUserRecord *) resp_data;
 		if (user_record) {
-			_show_info(gaim_account_get_connection(user->client_data),
+			_show_info(purple_account_get_connection(user->client_data),
 					   user_record);
 		}
 	} else {
-		gc = gaim_account_get_connection(user->client_data);
+		gc = purple_account_get_connection(user->client_data);
 		err =
 			g_strdup_printf(_("Could not get details for user %s (%s)."),
 					name, nm_error_to_string (ret_code));
-		gaim_notify_error(gc, NULL, err, NULL);
+		purple_notify_error(gc, NULL, err, NULL);
 		g_free(err);
 	}
 
@@ -717,7 +717,7 @@
 _get_details_resp_add_privacy_item(NMUser *user, NMERR_T ret_code,
 								   gpointer resp_data, gpointer user_data)
 {
-	GaimConnection *gc;
+	PurpleConnection *gc;
 	NMUserRecord *user_record = resp_data;
 	char *err;
 	gboolean allowed = GPOINTER_TO_INT(user_data);
@@ -726,7 +726,7 @@
 	if (user == NULL)
 		return;
 
-	gc = gaim_account_get_connection(user->client_data);
+	gc = purple_account_get_connection(user->client_data);
 	display_id = nm_user_record_get_display_id(user_record);
 
 	if (ret_code == NM_OK) {
@@ -735,14 +735,14 @@
 
 			if (!g_slist_find_custom(gc->account->permit,
 									 display_id, (GCompareFunc)nm_utf8_strcasecmp)) {
-				gaim_privacy_permit_add(gc->account, display_id, TRUE);
+				purple_privacy_permit_add(gc->account, display_id, TRUE);
 			}
 
 		} else {
 
 			if (!g_slist_find_custom(gc->account->permit,
 									 display_id, (GCompareFunc)nm_utf8_strcasecmp)) {
-				gaim_privacy_deny_add(gc->account, display_id, TRUE);
+				purple_privacy_deny_add(gc->account, display_id, TRUE);
 			}
 		}
 
@@ -750,7 +750,7 @@
 
 		err = g_strdup_printf(_("Unable to add user to privacy list (%s)."),
 							  nm_error_to_string(ret_code));
-		gaim_notify_error(gc, NULL, err, NULL);
+		purple_notify_error(gc, NULL, err, NULL);
 		g_free(err);
 
 	}
@@ -761,7 +761,7 @@
 _create_privacy_item_deny_resp_cb(NMUser *user, NMERR_T ret_code,
 								  gpointer resp_data, gpointer user_data)
 {
-	GaimConnection *gc;
+	PurpleConnection *gc;
 	NMUserRecord *user_record;
 	char *who = user_data;
 	char *err;
@@ -771,7 +771,7 @@
 	if (user == NULL)
 		return;
 
-	gc = gaim_account_get_connection(user->client_data);
+	gc = purple_account_get_connection(user->client_data);
 
 	if (ret_code == NM_OK) {
 
@@ -784,7 +784,7 @@
 			if (!g_slist_find_custom(gc->account->deny,
 									 display_id, (GCompareFunc)nm_utf8_strcasecmp)) {
 
-				gaim_privacy_deny_add(gc->account, display_id, TRUE);
+				purple_privacy_deny_add(gc->account, display_id, TRUE);
 			}
 
 		} else {
@@ -797,7 +797,7 @@
 
 		err = g_strdup_printf(_("Unable to add %s to deny list (%s)."),
 							  who, nm_error_to_string(ret_code));
-		gaim_notify_error(gc, NULL, err, NULL);
+		purple_notify_error(gc, NULL, err, NULL);
 		g_free(err);
 
 	}
@@ -812,7 +812,7 @@
 _create_privacy_item_permit_resp_cb(NMUser *user, NMERR_T ret_code,
 									gpointer resp_data, gpointer user_data)
 {
-	GaimConnection *gc;
+	PurpleConnection *gc;
 	NMUserRecord *user_record;
 	char *who = user_data;
 	char *err;
@@ -822,7 +822,7 @@
 	if (user == NULL)
 		return;
 
-	gc = gaim_account_get_connection(user->client_data);
+	gc = purple_account_get_connection(user->client_data);
 
 	if (ret_code == NM_OK) {
 
@@ -836,7 +836,7 @@
 									 display_id,
 									 (GCompareFunc)nm_utf8_strcasecmp)) {
 
-				gaim_privacy_permit_add(gc->account, display_id, TRUE);
+				purple_privacy_permit_add(gc->account, display_id, TRUE);
 			}
 
 		} else {
@@ -850,7 +850,7 @@
 
 		err = g_strdup_printf(_("Unable to add %s to permit list (%s)."), who,
 							  nm_error_to_string(ret_code));
-		gaim_notify_error(gc, NULL, err, NULL);
+		purple_notify_error(gc, NULL, err, NULL);
 		g_free(err);
 
 	}
@@ -864,7 +864,7 @@
 								 gpointer resp_data, gpointer user_data)
 {
 	NMERR_T rc = NM_OK;
-	GaimConnection *gc;
+	PurpleConnection *gc;
 	NMUserRecord *user_record = resp_data;
 	char *err;
 	gboolean allowed = GPOINTER_TO_INT(user_data);
@@ -873,7 +873,7 @@
 	if (user == NULL)
 		return;
 
-	gc = gaim_account_get_connection(user->client_data);
+	gc = purple_account_get_connection(user->client_data);
 	dn = nm_user_record_get_dn(user_record);
 	display_id = nm_user_record_get_display_id(user_record);
 
@@ -896,7 +896,7 @@
 
 		err = g_strdup_printf(_("Unable to add user to privacy list (%s)."),
 							  nm_error_to_string(ret_code));
-		gaim_notify_error(gc, NULL, err, NULL);
+		purple_notify_error(gc, NULL, err, NULL);
 		g_free(err);
 
 	}
@@ -906,7 +906,7 @@
 _remove_privacy_item_resp_cb(NMUser *user, NMERR_T ret_code,
 									gpointer resp_data, gpointer user_data)
 {
-	GaimConnection *gc;
+	PurpleConnection *gc;
 	char *who = user_data;
 	char *err;
 
@@ -915,10 +915,10 @@
 
 	if (ret_code != NM_OK) {
 
-		gc = gaim_account_get_connection(user->client_data);
+		gc = purple_account_get_connection(user->client_data);
 		err = g_strdup_printf(_("Unable to remove %s from privacy list (%s)."), who,
 							  nm_error_to_string(ret_code));
-		gaim_notify_error(gc, NULL, err, NULL);
+		purple_notify_error(gc, NULL, err, NULL);
 		g_free(err);
 	}
 
@@ -930,7 +930,7 @@
 _set_privacy_default_resp_cb(NMUser *user, NMERR_T ret_code,
 									gpointer resp_data, gpointer user_data)
 {
-	GaimConnection *gc;
+	PurpleConnection *gc;
 	char *err;
 
 	if (user == NULL)
@@ -938,10 +938,10 @@
 
 	if (ret_code != NM_OK) {
 
-		gc = gaim_account_get_connection(user->client_data);
+		gc = purple_account_get_connection(user->client_data);
 		err = g_strdup_printf(_("Unable to change server side privacy settings (%s)."),
 							  nm_error_to_string(ret_code));
-		gaim_notify_error(gc, NULL, err, NULL);
+		purple_notify_error(gc, NULL, err, NULL);
 		g_free(err);
 
 	}
@@ -953,7 +953,7 @@
 							  gpointer resp_data, gpointer user_data)
 {
 	NMERR_T rc = NM_OK;
-	GaimConnection *gc;
+	PurpleConnection *gc;
 	NMUserRecord *user_record = resp_data;
 	char *err;
 	GSList *cnode;
@@ -964,14 +964,14 @@
 	if (user == NULL)
 		return;
 
-	gc = gaim_account_get_connection(user->client_data);
+	gc = purple_account_get_connection(user->client_data);
 
 	if (ret_code == NM_OK) {
 
 		for (cnode = user->conferences; cnode != NULL; cnode = cnode->next) {
 			conference = cnode->data;
 			if (conference && (chat = nm_conference_get_data(conference))) {
-				if (gaim_conv_chat_get_id(GAIM_CONV_CHAT(chat)) == id) {
+				if (purple_conv_chat_get_id(PURPLE_CONV_CHAT(chat)) == id) {
 					rc = nm_send_conference_invite(user, conference, user_record,
 												   NULL, _sendinvite_resp_cb, NULL);
 					_check_for_disconnect(user, rc);
@@ -983,7 +983,7 @@
 	} else {
 
 		err = g_strdup_printf(_("Unable to invite user (%s)."), nm_error_to_string(ret_code));
-		gaim_notify_error(gc, NULL, err, NULL);
+		purple_notify_error(gc, NULL, err, NULL);
 		g_free(err);
 
 	}
@@ -996,7 +996,7 @@
 	NMERR_T rc = NM_OK;
 	NMConference *conference = resp_data;
 	NMUserRecord *user_record = user_data;
-	GaimConnection *gc;
+	PurpleConnection *gc;
 	char *err;
 
 	if (user == NULL)
@@ -1010,8 +1010,8 @@
 		_check_for_disconnect(user, rc);
 	} else {
 		err = g_strdup_printf(_("Unable to create conference (%s)."), nm_error_to_string(ret_code));
-		gc = gaim_account_get_connection(user->client_data);
-		gaim_notify_error(gc, NULL, err, NULL);
+		gc = purple_account_get_connection(user->client_data);
+		purple_notify_error(gc, NULL, err, NULL);
 		g_free(err);
 	}
 }
@@ -1038,7 +1038,7 @@
 		release = "Unknown";
 	}
 
-	return g_strdup_printf("Gaim/%s (%s; %s)", VERSION, sysname, release);
+	return g_strdup_printf("Purple/%s (%s; %s)", VERSION, sysname, release);
 
 #else
 
@@ -1096,7 +1096,7 @@
 		sysname = "Windows";
 	}
 
-	return g_strdup_printf("Gaim/%s (%s; %ld.%ld)", VERSION, sysname,
+	return g_strdup_printf("Purple/%s (%s; %ld.%ld)", VERSION, sysname,
 						   os_info.dwMajorVersion, os_info.dwMinorVersion);
 
 #endif
@@ -1114,11 +1114,11 @@
 static gboolean
 _check_for_disconnect(NMUser * user, NMERR_T err)
 {
-	GaimConnection *gc = gaim_account_get_connection(user->client_data);
+	PurpleConnection *gc = purple_account_get_connection(user->client_data);
 
 	if (_is_disconnect_error(err)) {
 
-		gaim_connection_error(gc, _("Error communicating with server."
+		purple_connection_error(gc, _("Error communicating with server."
 									" Closing connection."));
 		return TRUE;
 
@@ -1157,12 +1157,12 @@
 }
 
 /*
- * Update the status of the given buddy in the Gaim buddy list
+ * Update the status of the given buddy in the Purple buddy list
  */
 static void
-_update_buddy_status(NMUser *user, GaimBuddy * buddy, int novellstatus, int gmt)
+_update_buddy_status(NMUser *user, PurpleBuddy * buddy, int novellstatus, int gmt)
 {
-	GaimAccount *account;
+	PurpleAccount *account;
 	const char *status_id;
 	const char *text = NULL;
 	const char *dn;
@@ -1204,41 +1204,41 @@
 		}
 	}
 
-	gaim_prpl_got_user_status(account, buddy->name, status_id,
+	purple_prpl_got_user_status(account, buddy->name, status_id,
 							  "message", text, NULL);
-	gaim_prpl_got_user_idle(account, buddy->name,
+	purple_prpl_got_user_idle(account, buddy->name,
 							(novellstatus == NM_STATUS_AWAY_IDLE), idle);
 }
 
-/* Iterate through the cached Gaim buddy list and remove buddies
+/* Iterate through the cached Purple buddy list and remove buddies
  * that are not in the server side list.
  */
 static void
-_remove_gaim_buddies(NMUser *user)
+_remove_purple_buddies(NMUser *user)
 {
-	GaimBlistNode *gnode;
-	GaimBlistNode *cnode;
-	GaimBlistNode *bnode;
-	GaimGroup *group;
-	GaimBuddy *buddy;
-	GaimBuddyList *blist;
+	PurpleBlistNode *gnode;
+	PurpleBlistNode *cnode;
+	PurpleBlistNode *bnode;
+	PurpleGroup *group;
+	PurpleBuddy *buddy;
+	PurpleBuddyList *blist;
 	GSList *rem_list = NULL;
 	GSList *l;
 	NMFolder *folder = NULL;
 	const char *gname = NULL;
 
-	if ((blist = gaim_get_blist())) {
+	if ((blist = purple_get_blist())) {
 		for (gnode = blist->root; gnode; gnode = gnode->next) {
-			if (!GAIM_BLIST_NODE_IS_GROUP(gnode))
+			if (!PURPLE_BLIST_NODE_IS_GROUP(gnode))
 				continue;
-			group = (GaimGroup *) gnode;
+			group = (PurpleGroup *) gnode;
 			for (cnode = gnode->child; cnode; cnode = cnode->next) {
-				if (!GAIM_BLIST_NODE_IS_CONTACT(cnode))
+				if (!PURPLE_BLIST_NODE_IS_CONTACT(cnode))
 					continue;
 				for (bnode = cnode->child; bnode; bnode = bnode->next) {
-					if (!GAIM_BLIST_NODE_IS_BUDDY(bnode))
+					if (!PURPLE_BLIST_NODE_IS_BUDDY(bnode))
 						continue;
-					buddy = (GaimBuddy *) bnode;
+					buddy = (PurpleBuddy *) bnode;
 					if (buddy->account == user->client_data) {
 						gname = group->name;
 						if (strcmp(group->name, NM_ROOT_FOLDER_NAME) == 0)
@@ -1255,28 +1255,28 @@
 
 		if (rem_list) {
 			for (l = rem_list; l; l = l->next) {
-				gaim_blist_remove_buddy(l->data);
+				purple_blist_remove_buddy(l->data);
 			}
 			g_slist_free(rem_list);
 		}
 	}
 }
 
-/* Add all of the contacts in the given folder to the Gaim buddy list */
+/* Add all of the contacts in the given folder to the Purple buddy list */
 static void
-_add_contacts_to_gaim_blist(NMUser * user, NMFolder * folder)
+_add_contacts_to_purple_blist(NMUser * user, NMFolder * folder)
 {
 	NMUserRecord *user_record = NULL;
 	NMContact *contact = NULL;
-	GaimBuddy *buddy = NULL;
-	GaimGroup *group;
+	PurpleBuddy *buddy = NULL;
+	PurpleGroup *group;
 	NMERR_T cnt = 0, i;
 	const char *text = NULL;
 	const char *name = NULL;
 	const char *fname = NULL;
 	int status = 0;
 
-	/* If this is the root folder give it a name. Gaim does not have the concept of
+	/* If this is the root folder give it a name. Purple does not have the concept of
 	 * a root folder.
 	 */
 	fname = nm_folder_get_name(folder);
@@ -1284,11 +1284,11 @@
 		fname = NM_ROOT_FOLDER_NAME;
 	}
 
-	/* Does the Gaim group exist already? */
-	group = gaim_find_group(fname);
+	/* Does the Purple group exist already? */
+	group = purple_find_group(fname);
 	if (group == NULL) {
-		group = gaim_group_new(fname);
-		gaim_blist_add_group(group, NULL);
+		group = purple_group_new(fname);
+		purple_blist_add_group(group, NULL);
 	}
 
 	/* Get each contact for this folder */
@@ -1300,14 +1300,14 @@
 			name = nm_contact_get_display_id(contact);
 			if (name) {
 
-				buddy = gaim_find_buddy_in_group(user->client_data, name, group);
+				buddy = purple_find_buddy_in_group(user->client_data, name, group);
 				if (buddy == NULL) {
-					/* Add it to the gaim buddy list */
-					buddy = gaim_buddy_new(user->client_data,
+					/* Add it to the purple buddy list */
+					buddy = purple_buddy_new(user->client_data,
 										   name,
 										   nm_contact_get_display_name(contact));
 
-					gaim_blist_add_buddy(buddy, NULL, group, NULL);
+					purple_blist_add_buddy(buddy, NULL, group, NULL);
 				}
 
 				/* Set the initial status for the buddy */
@@ -1331,9 +1331,9 @@
 	}
 }
 
-/* Add all of the server side contacts to the Gaim buddy list. */
+/* Add all of the server side contacts to the Purple buddy list. */
 static void
-_add_gaim_buddies(NMUser * user)
+_add_purple_buddies(NMUser * user)
 {
 	int cnt = 0, i;
 	NMFolder *root_folder = NULL;
@@ -1344,19 +1344,19 @@
 
 		/* Add sub-folders and contacts to sub-folders...
 		 * iterate throught the sub-folders in reverse order
-		 * because Gaim adds the folders to the front -- so we
+		 * because Purple adds the folders to the front -- so we
 		 * want to add the first folder last
 		 */
 		cnt = nm_folder_get_subfolder_count(root_folder);
 		for (i = cnt-1; i >= 0; i--) {
 			folder = nm_folder_get_subfolder(root_folder, i);
 			if (folder) {
-				_add_contacts_to_gaim_blist(user, folder);
+				_add_contacts_to_purple_blist(user, folder);
 			}
 		}
 
 		/* Add contacts for the root folder */
-		_add_contacts_to_gaim_blist(user, root_folder);
+		_add_contacts_to_purple_blist(user, root_folder);
 	}
 }
 
@@ -1368,8 +1368,8 @@
 	 * from the server side list that are not in
 	 * the local list
 	 */
-	_remove_gaim_buddies(user);
-	_add_gaim_buddies(user);
+	_remove_purple_buddies(user);
+	_add_purple_buddies(user);
 	user->clist_synched = TRUE;
 }
 
@@ -1377,29 +1377,29 @@
 _sync_privacy_lists(NMUser *user)
 {
 	GSList *node = NULL, *rem_list = NULL;
-	GaimConnection *gc;
+	PurpleConnection *gc;
 	const char *name, *dn;
 	NMUserRecord *user_record;
 
 	if (user == NULL)
 		return;
 
-	gc = gaim_account_get_connection(user->client_data);
+	gc = purple_account_get_connection(user->client_data);
 	if (gc == NULL)
 		return;
 
-	/* Set the Gaim privacy setting */
+	/* Set the Purple privacy setting */
 	if (user->default_deny) {
 		if (user->allow_list == NULL) {
-			gc->account->perm_deny = GAIM_PRIVACY_DENY_ALL;
+			gc->account->perm_deny = PURPLE_PRIVACY_DENY_ALL;
 		} else {
-			gc->account->perm_deny = GAIM_PRIVACY_ALLOW_USERS;
+			gc->account->perm_deny = PURPLE_PRIVACY_ALLOW_USERS;
 		}
 	} else {
 		if (user->deny_list == NULL) {
-			gc->account->perm_deny = GAIM_PRIVACY_ALLOW_ALL;
+			gc->account->perm_deny = PURPLE_PRIVACY_ALLOW_ALL;
 		} else {
-			gc->account->perm_deny = GAIM_PRIVACY_DENY_USERS;
+			gc->account->perm_deny = PURPLE_PRIVACY_DENY_USERS;
 		}
 	}
 
@@ -1413,7 +1413,7 @@
 
 		if (!g_slist_find_custom(gc->account->permit,
 								 name, (GCompareFunc)nm_utf8_strcasecmp)) {
-			gaim_privacy_permit_add(gc->account, name , TRUE);
+			purple_privacy_permit_add(gc->account, name , TRUE);
 		}
 	}
 
@@ -1426,7 +1426,7 @@
 
 		if (!g_slist_find_custom(gc->account->deny,
 								 name, (GCompareFunc)nm_utf8_strcasecmp)) {
-			gaim_privacy_deny_add(gc->account, name, TRUE);
+			purple_privacy_deny_add(gc->account, name, TRUE);
 		}
 	}
 
@@ -1443,7 +1443,7 @@
 
 	if (rem_list) {
 		for (node = rem_list; node; node = node->next) {
-			gaim_privacy_permit_remove(gc->account, (char *)node->data, TRUE);
+			purple_privacy_permit_remove(gc->account, (char *)node->data, TRUE);
 		}
 		g_free(rem_list);
 		rem_list = NULL;
@@ -1460,7 +1460,7 @@
 
 	if (rem_list) {
 		for (node = rem_list; node; node = node->next) {
-			gaim_privacy_deny_remove(gc->account, (char *)node->data, TRUE);
+			purple_privacy_deny_remove(gc->account, (char *)node->data, TRUE);
 		}
 		g_slist_free(rem_list);
 	}
@@ -1492,9 +1492,9 @@
 
 /* Display a dialog box showing the properties for the given user record */
 static void
-_show_info(GaimConnection * gc, NMUserRecord * user_record)
+_show_info(PurpleConnection * gc, NMUserRecord * user_record)
 {
-	GaimNotifyUserInfo *user_info =	gaim_notify_user_info_new();
+	PurpleNotifyUserInfo *user_info =	purple_notify_user_info_new();
 	GString *info_text;
 	int count, i;
 	NMProperty *property;
@@ -1505,20 +1505,20 @@
 	tag = _("User ID");
 	value = nm_user_record_get_userid(user_record);
 	if (value) {
-		gaim_notify_user_info_add_pair(user_info, tag, value);
+		purple_notify_user_info_add_pair(user_info, tag, value);
 	}
 
 /*	tag = _("DN");
 	value = nm_user_record_get_dn(user_record);
 	if (value) {
-		gaim_notify_user_info_add_pair(user_info, tag, value);
+		purple_notify_user_info_add_pair(user_info, tag, value);
 	}
 */
 
 	tag = _("Full name");
 	value = nm_user_record_get_full_name(user_record);
 	if (value) {
-		gaim_notify_user_info_add_pair(user_info, tag, value);
+		purple_notify_user_info_add_pair(user_info, tag, value);
 	}
 
 	count = nm_user_record_get_property_count(user_record);
@@ -1528,20 +1528,20 @@
 			tag = _map_property_tag(nm_property_get_tag(property));
 			value = nm_property_get_value(property);
 			if (tag && value) {
-				gaim_notify_user_info_add_pair(user_info, tag, value);
+				purple_notify_user_info_add_pair(user_info, tag, value);
 			}
 			nm_release_property(property);
 		}
 	}
 
-	gaim_notify_userinfo(gc, nm_user_record_get_userid(user_record), 
+	purple_notify_userinfo(gc, nm_user_record_get_userid(user_record), 
 						 user_info, NULL, NULL);
-	gaim_notify_user_info_destroy(user_info);
+	purple_notify_user_info_destroy(user_info);
 }
 
 /* Send a join conference, the first item in the parms list is the
  * NMUser object and the second item is the conference to join.
- * This callback is passed to gaim_request_action when we ask the
+ * This callback is passed to purple_request_action when we ask the
  * user if they want to join the conference.
  */
 static void
@@ -1568,7 +1568,7 @@
 
 /* Send a reject conference, the first item in the parms list is the
  * NMUser object and the second item is the conference to reject.
- * This callback is passed to gaim_request_action when we ask the
+ * This callback is passed to purple_request_action when we ask the
  * user if they want to joing the conference.
  */
 static void
@@ -1593,21 +1593,21 @@
 }
 
 static void
-_initiate_conference_cb(GaimBlistNode *node, gpointer ignored)
+_initiate_conference_cb(PurpleBlistNode *node, gpointer ignored)
 {
-	GaimBuddy *buddy;
-	GaimConnection *gc;
+	PurpleBuddy *buddy;
+	PurpleConnection *gc;
 
 	NMUser *user;
 	const char *conf_name;
-	GaimConversation *chat = NULL;
+	PurpleConversation *chat = NULL;
 	NMUserRecord *user_record;
 	NMConference *conference;
 
-	g_return_if_fail(GAIM_BLIST_NODE_IS_BUDDY(node));
-
-	buddy = (GaimBuddy *) node;
-	gc = gaim_account_get_connection(buddy->account);
+	g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node));
+
+	buddy = (PurpleBuddy *) node;
+	gc = purple_account_get_connection(buddy->account);
 
 	user = gc->proto_data;
 	if (user == NULL)
@@ -1643,13 +1643,13 @@
 }
 
 static void
-_show_privacy_locked_error(GaimConnection *gc, NMUser *user)
+_show_privacy_locked_error(PurpleConnection *gc, NMUser *user)
 {
 	char *err;
 
 	err = g_strdup_printf(_("Unable to change server side privacy settings (%s)."),
 						  nm_error_to_string(NMERR_ADMIN_LOCKED));
-	gaim_notify_error(gc, NULL, err, NULL);
+	purple_notify_error(gc, NULL, err, NULL);
 	g_free(err);
 }
 
@@ -1658,24 +1658,24 @@
  ******************************************************************************/
 
 static void
-novell_ssl_connect_error(GaimSslConnection * gsc,
-						 GaimSslErrorType error, gpointer data)
+novell_ssl_connect_error(PurpleSslConnection * gsc,
+						 PurpleSslErrorType error, gpointer data)
 {
-	GaimConnection *gc;
+	PurpleConnection *gc;
 	NMUser *user;
 
 	gc = data;
 	user = gc->proto_data;
 	user->conn->ssl_conn->data = NULL;
 
-	gaim_connection_error(gc, _("Unable to make SSL connection to server."));
+	purple_connection_error(gc, _("Unable to make SSL connection to server."));
 }
 
 static void
-novell_ssl_recv_cb(gpointer data, GaimSslConnection * gsc,
-				   GaimInputCondition condition)
+novell_ssl_recv_cb(gpointer data, PurpleSslConnection * gsc,
+				   PurpleInputCondition condition)
 {
-	GaimConnection *gc = data;
+	PurpleConnection *gc = data;
 	NMUser *user;
 	NMERR_T rc;
 
@@ -1691,21 +1691,21 @@
 
 		if (_is_disconnect_error(rc)) {
 
-			gaim_connection_error(gc,
+			purple_connection_error(gc,
 								  _("Error communicating with server."
 									" Closing connection."));
 		} else {
-			gaim_debug(GAIM_DEBUG_INFO, "novell",
+			purple_debug(PURPLE_DEBUG_INFO, "novell",
 					   "Error processing event or response (%d).\n", rc);
 		}
 	}
 }
 
 static void
-novell_ssl_connected_cb(gpointer data, GaimSslConnection * gsc,
-						GaimInputCondition cond)
+novell_ssl_connected_cb(gpointer data, PurpleSslConnection * gsc,
+						PurpleInputCondition cond)
 {
-	GaimConnection *gc = data;
+	PurpleConnection *gc = data;
 	NMUser *user;
 	NMConn *conn;
 	NMERR_T rc = 0;
@@ -1720,22 +1720,22 @@
 	if ((user == NULL) || (conn = user->conn) == NULL)
 		return;
 
-	gaim_connection_update_progress(gc, _("Authenticating..."),
+	purple_connection_update_progress(gc, _("Authenticating..."),
 									2, NOVELL_CONNECT_STEPS);
 
-	my_addr = gaim_network_get_my_ip(gsc->fd);
-	pwd = gaim_connection_get_password(gc);
+	my_addr = purple_network_get_my_ip(gsc->fd);
+	pwd = purple_connection_get_password(gc);
 	ua = _user_agent_string();
 
 	rc = nm_send_login(user, pwd, my_addr, ua, _login_resp_cb, NULL);
 	if (rc == NM_OK) {
 		conn->connected = TRUE;
-		gaim_ssl_input_add(gsc, novell_ssl_recv_cb, gc);
+		purple_ssl_input_add(gsc, novell_ssl_recv_cb, gc);
 	} else {
-		gaim_connection_error(gc, _("Unable to connect to server."));
+		purple_connection_error(gc, _("Unable to connect to server."));
 	}
 
-	gaim_connection_update_progress(gc, _("Waiting for response..."),
+	purple_connection_update_progress(gc, _("Waiting for response..."),
 									3, NOVELL_CONNECT_STEPS);
 
 	g_free(ua);
@@ -1750,9 +1750,9 @@
 {
 	NMUserRecord *user_record = NULL;
 	NMContact *contact = NULL;
-	GaimConversation *gconv;
+	PurpleConversation *gconv;
 	NMConference *conference;
-	GaimMessageFlags flags;
+	PurpleMessageFlags flags;
 	char *text = NULL;
 
 	text = g_markup_escape_text(nm_event_get_text(event), -1);
@@ -1760,7 +1760,7 @@
 	conference = nm_event_get_conference(event);
 	if (conference) {
 
-		GaimConversation *chat = nm_conference_get_data(conference);
+		PurpleConversation *chat = nm_conference_get_data(conference);
 
 		/* Is this a single person 'conversation' or a conference? */
 		if (chat == NULL && nm_conference_get_participant_count(conference) == 1) {
@@ -1770,22 +1770,22 @@
 
 				flags = 0;
 				if (nm_event_get_type(event) == NMEVT_RECEIVE_AUTOREPLY)
-					flags |= GAIM_MESSAGE_AUTO_RESP;
-
-				serv_got_im(gaim_account_get_connection(user->client_data),
+					flags |= PURPLE_MESSAGE_AUTO_RESP;
+
+				serv_got_im(purple_account_get_connection(user->client_data),
 							nm_user_record_get_display_id(user_record),
 							text, flags,
 							nm_event_get_gmt(event));
 
-				gconv =	gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM,
+				gconv =	purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM,
 					nm_user_record_get_display_id(user_record),
-					(GaimAccount *) user->client_data);
+					(PurpleAccount *) user->client_data);
 				if (gconv) {
 
 					contact = nm_find_contact(user, nm_event_get_source(event));
 					if (contact) {
 
-						gaim_conversation_set_title(
+						purple_conversation_set_title(
 							gconv, nm_contact_get_display_name(contact));
 
 
@@ -1797,7 +1797,7 @@
 						if (name == NULL)
 							name = nm_user_record_get_userid(user_record);
 
-						gaim_conversation_set_title(gconv, name);
+						purple_conversation_set_title(gconv, name);
 					}
 
 				}
@@ -1827,8 +1827,8 @@
 						name = nm_user_record_get_display_id(user_record);
 				}
 
-				serv_got_chat_in(gaim_account_get_connection(user->client_data),
-								 gaim_conv_chat_get_id(GAIM_CONV_CHAT(chat)),
+				serv_got_chat_in(purple_account_get_connection(user->client_data),
+								 purple_conv_chat_get_id(PURPLE_CONV_CHAT(chat)),
 								 name, 0, text, nm_event_get_gmt(event));
 			}
 		}
@@ -1840,7 +1840,7 @@
 static void
 _evt_conference_left(NMUser * user, NMEvent * event)
 {
-	GaimConversation *chat;
+	PurpleConversation *chat;
 	NMConference *conference;
 
 	conference = nm_event_get_conference(event);
@@ -1851,7 +1851,7 @@
 												   nm_event_get_source(event));
 
 			if (ur)
-				gaim_conv_chat_remove_user(GAIM_CONV_CHAT(chat),
+				purple_conv_chat_remove_user(PURPLE_CONV_CHAT(chat),
 										   nm_user_record_get_display_id(ur),
 										   NULL);
 		}
@@ -1861,7 +1861,7 @@
 static void
 _evt_conference_invite_notify(NMUser * user, NMEvent * event)
 {
-	GaimConversation *gconv;
+	PurpleConversation *gconv;
 	NMConference *conference;
 	NMUserRecord *user_record = NULL;
 	char *str = NULL;
@@ -1872,8 +1872,8 @@
 		gconv = nm_conference_get_data(conference);
 		str = g_strdup_printf(_("%s has been invited to this conversation."),
 							  nm_user_record_get_display_id(user_record));
-		gaim_conversation_write(gconv, NULL, str,
-								GAIM_MESSAGE_SYSTEM, time(NULL));
+		purple_conversation_write(gconv, NULL, str,
+								PURPLE_MESSAGE_SYSTEM, time(NULL));
 		g_free(str);
 	}
 }
@@ -1882,7 +1882,7 @@
 _evt_conference_invite(NMUser * user, NMEvent * event)
 {
 	NMUserRecord *ur;
-	GaimConnection *gc;
+	PurpleConnection *gc;
 	GSList *parms = NULL;
 	const char *title = NULL;
 	const char *secondary = NULL;
@@ -1900,7 +1900,7 @@
 	gmt = nm_event_get_gmt(event);
 	title = _("Invitation to Conversation");
 	primary = g_strdup_printf(_("Invitation from: %s\n\nSent: %s"),
-							  name, gaim_date_format_full(localtime(&gmt)));
+							  name, purple_date_format_full(localtime(&gmt)));
 	secondary = _("Would you like to join the conversation?");
 
 	/* Set up parms list for the callbacks
@@ -1912,9 +1912,9 @@
 	parms = g_slist_append(parms, nm_event_get_conference(event));
 
 	/* Prompt the user */
-	gc = gaim_account_get_connection(user->client_data);
-	gaim_request_action(gc, title, primary, secondary,
-						GAIM_DEFAULT_ACTION_NONE, parms, 2,
+	gc = purple_account_get_connection(user->client_data);
+	purple_request_action(gc, title, primary, secondary,
+						PURPLE_DEFAULT_ACTION_NONE, parms, 2,
 						_("Yes"), G_CALLBACK(_join_conference_cb),
 						_("No"), G_CALLBACK(_reject_conference_cb));
 
@@ -1925,14 +1925,14 @@
 static void
 _evt_conference_joined(NMUser * user, NMEvent * event)
 {
-	GaimConversation *chat = NULL;
-	GaimConnection *gc;
+	PurpleConversation *chat = NULL;
+	PurpleConnection *gc;
 	NMConference *conference = NULL;
 	NMUserRecord *ur = NULL;
 	const char *name;
 	const char *conf_name;
 
-	gc = gaim_account_get_connection(user->client_data);
+	gc = purple_account_get_connection(user->client_data);
 	if (gc == NULL)
 		return;
 
@@ -1950,8 +1950,8 @@
 					nm_conference_set_data(conference, (gpointer) chat);
 
 					name = nm_user_record_get_display_id(ur);
-					gaim_conv_chat_add_user(GAIM_CONV_CHAT(chat), name, NULL, 
-											GAIM_CBFLAGS_NONE, TRUE);
+					purple_conv_chat_add_user(PURPLE_CONV_CHAT(chat), name, NULL, 
+											PURPLE_CBFLAGS_NONE, TRUE);
 
 				}
 			}
@@ -1961,9 +1961,9 @@
 			ur = nm_find_user_record(user, nm_event_get_source(event));
 			if (ur) {
 				name = nm_user_record_get_display_id(ur);
-				if (!gaim_conv_chat_find_user(GAIM_CONV_CHAT(chat), name)) {
-					gaim_conv_chat_add_user(GAIM_CONV_CHAT(chat), name, NULL, 
-											GAIM_CBFLAGS_NONE, TRUE);
+				if (!purple_conv_chat_find_user(PURPLE_CONV_CHAT(chat), name)) {
+					purple_conv_chat_add_user(PURPLE_CONV_CHAT(chat), name, NULL, 
+											PURPLE_CBFLAGS_NONE, TRUE);
 				}
 			}
 		}
@@ -1973,7 +1973,7 @@
 static void
 _evt_status_change(NMUser * user, NMEvent * event)
 {
-	GaimBuddy *buddy = NULL;
+	PurpleBuddy *buddy = NULL;
 	GSList *buddies;
 	GSList *bnode;
 	NMUserRecord *user_record;
@@ -1988,9 +1988,9 @@
 
 		/* Update status for buddy in all folders */
 		display_id = nm_user_record_get_display_id(user_record);
-		buddies = gaim_find_buddies(user->client_data, display_id);
+		buddies = purple_find_buddies(user->client_data, display_id);
 		for (bnode = buddies; bnode; bnode = bnode->next) {
-			buddy = (GaimBuddy *) bnode->data;
+			buddy = (PurpleBuddy *) bnode->data;
 			if (buddy) {
 				_update_buddy_status(user, buddy, status, nm_event_get_gmt(event));
 			}
@@ -2004,13 +2004,13 @@
 static void
 _evt_user_disconnect(NMUser * user, NMEvent * event)
 {
-	GaimConnection *gc;
-
-	gc = gaim_account_get_connection((GaimAccount *) user->client_data);
+	PurpleConnection *gc;
+
+	gc = purple_account_get_connection((PurpleAccount *) user->client_data);
 	if (gc)
 	{
 		gc->wants_to_die = TRUE; /* we don't want to reconnect in this case */
-		gaim_connection_error(gc, _("You have been logged out because you"
+		purple_connection_error(gc, _("You have been logged out because you"
 									" logged in at another workstation."));
 	}
 }
@@ -2018,15 +2018,15 @@
 static void
 _evt_user_typing(NMUser * user, NMEvent * event)
 {
-	GaimConnection *gc;
+	PurpleConnection *gc;
 	NMUserRecord *user_record = NULL;
 
-	gc = gaim_account_get_connection((GaimAccount *) user->client_data);
+	gc = purple_account_get_connection((PurpleAccount *) user->client_data);
 	if (gc) {
 		user_record = nm_find_user_record(user, nm_event_get_source(event));
 		if (user_record) {
 			serv_got_typing(gc, nm_user_record_get_display_id(user_record),
-							30, GAIM_TYPING);
+							30, PURPLE_TYPING);
 		}
 	}
 }
@@ -2034,10 +2034,10 @@
 static void
 _evt_user_not_typing(NMUser * user, NMEvent * event)
 {
-	GaimConnection *gc;
+	PurpleConnection *gc;
 	NMUserRecord *user_record;
 
-	gc = gaim_account_get_connection((GaimAccount *) user->client_data);
+	gc = purple_account_get_connection((PurpleAccount *) user->client_data);
 	if (gc) {
 		user_record = nm_find_user_record(user, nm_event_get_source(event));
 		if (user_record) {
@@ -2051,14 +2051,14 @@
 _evt_undeliverable_status(NMUser * user, NMEvent * event)
 {
 	NMUserRecord *ur;
-	GaimConversation *gconv;
+	PurpleConversation *gconv;
 	char *str;
 
 	ur = nm_find_user_record(user, nm_event_get_source(event));
 	if (ur) {
-		/* XXX - Should this be GAIM_CONV_TYPE_IM? */
+		/* XXX - Should this be PURPLE_CONV_TYPE_IM? */
 		gconv =
-			gaim_find_conversation_with_account(GAIM_CONV_TYPE_ANY,
+			purple_find_conversation_with_account(PURPLE_CONV_TYPE_ANY,
 												nm_user_record_get_display_id(ur),
 												user->client_data);
 		if (gconv) {
@@ -2069,8 +2069,8 @@
 			}
 			str = g_strdup_printf(_("%s appears to be offline and did not receive"
 									" the message that you just sent."), name);
-			gaim_conversation_write(gconv, NULL, str,
-									GAIM_MESSAGE_SYSTEM, time(NULL));
+			purple_conversation_write(gconv, NULL, str,
+									PURPLE_MESSAGE_SYSTEM, time(NULL));
 			g_free(str);
 		}
 	}
@@ -2130,7 +2130,7 @@
 			_evt_conference_left(user, event);
 			break;
 		default:
-			gaim_debug(GAIM_DEBUG_INFO, "novell",
+			purple_debug(PURPLE_DEBUG_INFO, "novell",
 					   "_event_callback(): unhandled event, %d\n",
 					   nm_event_get_type(event));
 			break;
@@ -2142,9 +2142,9 @@
  ******************************************************************************/
 
 static void
-novell_login(GaimAccount * account)
+novell_login(PurpleAccount * account)
 {
-	GaimConnection *gc;
+	PurpleConnection *gc;
 	NMUser *user = NULL;
 	const char *server;
 	const char *name;
@@ -2153,26 +2153,26 @@
 	if (account == NULL)
 		return;
 
-	gc = gaim_account_get_connection(account);
+	gc = purple_account_get_connection(account);
 	if (gc == NULL)
 		return;
 
-	server = gaim_account_get_string(account, "server", NULL);
+	server = purple_account_get_string(account, "server", NULL);
 	if (server == NULL || *server == '\0') {
 
 		/* TODO: Would be nice to prompt if not set!
-		 *  gaim_request_fields(gc, _("Server Address"),...);
+		 *  purple_request_fields(gc, _("Server Address"),...);
 		 */
 
 		/* ...but for now just error out with a nice message. */
-		gaim_connection_error(gc, _("Unable to connect to server."
+		purple_connection_error(gc, _("Unable to connect to server."
 									" Please enter the address of the server"
 									" you wish to connect to."));
 		return;
 	}
 
-	port = gaim_account_get_int(account, "port", DEFAULT_PORT);
-	name = gaim_account_get_username(account);
+	port = purple_account_get_int(account, "port", DEFAULT_PORT);
+	name = purple_account_get_username(account);
 
 	user = nm_initialize_user(name, server, port, account, _event_callback);
 	if (user && user->conn) {
@@ -2180,27 +2180,27 @@
 		gc->proto_data = user;
 
 		/* connect to the server */
-		gaim_connection_update_progress(gc, _("Connecting"),
+		purple_connection_update_progress(gc, _("Connecting"),
 										1, NOVELL_CONNECT_STEPS);
 
 		user->conn->use_ssl = TRUE;
 
 		user->conn->ssl_conn = g_new0(NMSSLConn, 1);
-		user->conn->ssl_conn->read = (nm_ssl_read_cb) gaim_ssl_read;
-		user->conn->ssl_conn->write = (nm_ssl_write_cb) gaim_ssl_write;
-
-		user->conn->ssl_conn->data = gaim_ssl_connect(user->client_data,
+		user->conn->ssl_conn->read = (nm_ssl_read_cb) purple_ssl_read;
+		user->conn->ssl_conn->write = (nm_ssl_write_cb) purple_ssl_write;
+
+		user->conn->ssl_conn->data = purple_ssl_connect(user->client_data,
 													  user->conn->addr, user->conn->port,
 													  novell_ssl_connected_cb, novell_ssl_connect_error, gc);
 		if (user->conn->ssl_conn->data == NULL) {
-			gaim_connection_error(gc, _("Error."
+			purple_connection_error(gc, _("Error."
 										" SSL support is not installed."));
 		}
 	}
 }
 
 static void
-novell_close(GaimConnection * gc)
+novell_close(PurpleConnection * gc)
 {
 	NMUser *user;
 	NMConn *conn;
@@ -2212,7 +2212,7 @@
 	if (user) {
 		conn = user->conn;
 		if (conn && conn->ssl_conn) {
-			gaim_ssl_close(user->conn->ssl_conn->data);
+			purple_ssl_close(user->conn->ssl_conn->data);
 		}
 		nm_deinitialize_user(user);
 	}
@@ -2220,8 +2220,8 @@
 }
 
 static int
-novell_send_im(GaimConnection * gc, const char *name,
-			   const char *message_body, GaimMessageFlags flags)
+novell_send_im(PurpleConnection * gc, const char *name,
+			   const char *message_body, PurpleMessageFlags flags)
 {
 	NMUserRecord *user_record = NULL;
 	NMConference *conf = NULL;
@@ -2241,7 +2241,7 @@
 		return 0;
 
 	/* Create a new message */
-	plain = gaim_unescape_html(message_body);
+	plain = purple_unescape_html(message_body);
 	message = nm_create_message(plain);
 	g_free(plain);
 
@@ -2312,7 +2312,7 @@
 }
 
 static unsigned int
-novell_send_typing(GaimConnection * gc, const char *name, GaimTypingState state)
+novell_send_typing(PurpleConnection * gc, const char *name, PurpleTypingState state)
 {
 	NMConference *conf = NULL;
 	NMUser *user;
@@ -2335,7 +2335,7 @@
 		if (conf) {
 
 			rc = nm_send_typing(user, conf,
-								((state == GAIM_TYPING) ? TRUE : FALSE), NULL);
+								((state == PURPLE_TYPING) ? TRUE : FALSE), NULL);
 			_check_for_disconnect(user, rc);
 
 		}
@@ -2346,7 +2346,7 @@
 }
 
 static void
-novell_convo_closed(GaimConnection * gc, const char *who)
+novell_convo_closed(PurpleConnection * gc, const char *who)
 {
 	NMUser *user;
 	NMConference *conf;
@@ -2367,11 +2367,11 @@
 }
 
 static void
-novell_chat_leave(GaimConnection * gc, int id)
+novell_chat_leave(PurpleConnection * gc, int id)
 {
 	NMConference *conference;
 	NMUser *user;
-	GaimConversation *chat;
+	PurpleConversation *chat;
 	GSList *cnode;
 	NMERR_T rc = NM_OK;
 
@@ -2385,7 +2385,7 @@
 	for (cnode = user->conferences; cnode != NULL; cnode = cnode->next) {
 		conference = cnode->data;
 		if (conference && (chat = nm_conference_get_data(conference))) {
-			if (gaim_conv_chat_get_id(GAIM_CONV_CHAT(chat)) == id) {
+			if (purple_conv_chat_get_id(PURPLE_CONV_CHAT(chat)) == id) {
 				rc = nm_send_leave_conference(user, conference, NULL, NULL);
 				_check_for_disconnect(user, rc);
 				break;
@@ -2397,12 +2397,12 @@
 }
 
 static void
-novell_chat_invite(GaimConnection *gc, int id,
+novell_chat_invite(PurpleConnection *gc, int id,
 				   const char *message, const char *who)
 {
 	NMConference *conference;
 	NMUser *user;
-	GaimConversation *chat;
+	PurpleConversation *chat;
 	GSList *cnode;
 	NMERR_T rc = NM_OK;
 	NMUserRecord *user_record = NULL;
@@ -2424,7 +2424,7 @@
 	for (cnode = user->conferences; cnode != NULL; cnode = cnode->next) {
 		conference = cnode->data;
 		if (conference && (chat = nm_conference_get_data(conference))) {
-			if (gaim_conv_chat_get_id(GAIM_CONV_CHAT(chat)) == id) {
+			if (purple_conv_chat_get_id(PURPLE_CONV_CHAT(chat)) == id) {
 				rc = nm_send_conference_invite(user, conference, user_record,
 											   message, _sendinvite_resp_cb, NULL);
 				_check_for_disconnect(user, rc);
@@ -2435,10 +2435,10 @@
 }
 
 static int
-novell_chat_send(GaimConnection * gc, int id, const char *text, GaimMessageFlags flags)
+novell_chat_send(PurpleConnection * gc, int id, const char *text, PurpleMessageFlags flags)
 {
 	NMConference *conference;
-	GaimConversation *chat;
+	PurpleConversation *chat;
 	GSList *cnode;
 	NMMessage *message;
 	NMUser *user;
@@ -2453,14 +2453,14 @@
 	if (user == NULL)
 		return -1;
 
-	plain = gaim_unescape_html(text);
+	plain = purple_unescape_html(text);
 	message = nm_create_message(plain);
 	g_free(plain);
 
 	for (cnode = user->conferences; cnode != NULL; cnode = cnode->next) {
 		conference = cnode->data;
 		if (conference && (chat = nm_conference_get_data(conference))) {
-			if (gaim_conv_chat_get_id(GAIM_CONV_CHAT(chat)) == id) {
+			if (purple_conv_chat_get_id(PURPLE_CONV_CHAT(chat)) == id) {
 
 				nm_message_set_conference(message, conference);
 
@@ -2477,7 +2477,7 @@
 				if (!_check_for_disconnect(user, rc)) {
 
 					/* Use the account alias if it is set */
-					name = gaim_account_get_alias(user->client_data);
+					name = purple_account_get_alias(user->client_data);
 					if (name == NULL || *name == '\0') {
 
 						/* If there is no account alias, try full name */
@@ -2485,7 +2485,7 @@
 						if (name == NULL || *name == '\0') {
 
 							/* Fall back to the username that we are signed in with */
-							name = gaim_account_get_username(user->client_data);
+							name = purple_account_get_username(user->client_data);
 						}
 					}
 
@@ -2500,11 +2500,11 @@
 
 
 	/* The conference was not found, must be closed */
-	chat = gaim_find_chat(gc, id);
+	chat = purple_find_chat(gc, id);
 	if (chat) {
 		str = g_strdup_printf(_("This conference has been closed."
 								" No more messages can be sent."));
-		gaim_conversation_write(chat, NULL, str, GAIM_MESSAGE_SYSTEM, time(NULL));
+		purple_conversation_write(chat, NULL, str, PURPLE_MESSAGE_SYSTEM, time(NULL));
 		g_free(str);
 	}
 
@@ -2515,7 +2515,7 @@
 }
 
 static void
-novell_add_buddy(GaimConnection * gc, GaimBuddy *buddy, GaimGroup * group)
+novell_add_buddy(PurpleConnection * gc, PurpleBuddy *buddy, PurpleGroup * group)
 {
 	NMFolder *folder = NULL;
 	NMContact *contact;
@@ -2539,14 +2539,14 @@
 	contact = nm_create_contact();
 	nm_contact_set_dn(contact, buddy->name);
 
-	/* Remove the GaimBuddy (we will add it back after adding it
+	/* Remove the PurpleBuddy (we will add it back after adding it
 	 * to the server side list). Save the alias if there is one.
 	 */
-	alias = gaim_buddy_get_alias(buddy);
+	alias = purple_buddy_get_alias(buddy);
 	if (alias && strcmp(alias, buddy->name))
 		nm_contact_set_display_name(contact, alias);
 
-	gaim_blist_remove_buddy(buddy);
+	purple_blist_remove_buddy(buddy);
 	buddy = NULL;
 
 	if (strcmp(group->name, NM_ROOT_FOLDER_NAME) == 0) {
@@ -2574,7 +2574,7 @@
 }
 
 static void
-novell_remove_buddy(GaimConnection *gc, GaimBuddy *buddy, GaimGroup *group)
+novell_remove_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group)
 {
 	NMContact *contact;
 	NMFolder *folder;
@@ -2610,7 +2610,7 @@
 }
 
 static void
-novell_remove_group(GaimConnection * gc, GaimGroup *group)
+novell_remove_group(PurpleConnection * gc, PurpleGroup *group)
 {
 	NMUser *user;
 	NMERR_T rc = NM_OK;
@@ -2631,7 +2631,7 @@
 }
 
 static void
-novell_alias_buddy(GaimConnection * gc, const char *name, const char *alias)
+novell_alias_buddy(PurpleConnection * gc, const char *name, const char *alias)
 {
 	NMContact *contact;
 	NMUser *user;
@@ -2651,11 +2651,11 @@
 		for (cnode = contacts; cnode != NULL; cnode = cnode->next) {
 			contact = (NMContact *) cnode->data;
 			if (contact) {
-				GaimGroup *group = NULL;
-				GaimBuddy *buddy;
+				PurpleGroup *group = NULL;
+				PurpleBuddy *buddy;
 				NMFolder *folder;
 
-				/* Alias the Gaim buddy? */
+				/* Alias the Purple buddy? */
 				folder = nm_find_folder_by_id(user,
 											  nm_contact_get_parent_id(contact));
 				if (folder) {
@@ -2663,14 +2663,14 @@
 					if (*fname == '\0') {
 						fname = NM_ROOT_FOLDER_NAME;
 					}
-					group = gaim_find_group(fname);
+					group = purple_find_group(fname);
 				}
 
 				if (group) {
-					buddy = gaim_find_buddy_in_group(user->client_data,
+					buddy = purple_find_buddy_in_group(user->client_data,
 													 name, group);
 					if (buddy && strcmp(buddy->alias, alias))
-						gaim_blist_alias_buddy(buddy, alias);
+						purple_blist_alias_buddy(buddy, alias);
 				}
 
 				/* Tell the server to alias the contact */
@@ -2685,7 +2685,7 @@
 }
 
 static void
-novell_group_buddy(GaimConnection * gc,
+novell_group_buddy(PurpleConnection * gc,
 				   const char *name, const char *old_group_name,
 				   const char *new_group_name)
 {
@@ -2747,8 +2747,8 @@
 }
 
 static void
-novell_rename_group(GaimConnection * gc, const char *old_name,
-					GaimGroup *group, GList *moved_buddies)
+novell_rename_group(PurpleConnection * gc, const char *old_name,
+					PurpleGroup *group, GList *moved_buddies)
 {
 	NMERR_T rc = NM_OK;
 	NMFolder *folder;
@@ -2762,7 +2762,7 @@
 	if (user) {
 		/* Does new folder exist already? */
 		if (nm_find_folder(user, group->name)) {
-			/* gaim_blist_rename_group() adds the buddies
+			/* purple_blist_rename_group() adds the buddies
 			 * to the new group and removes the old group...
 			 * so there is nothing more to do here.
 			 */
@@ -2784,16 +2784,16 @@
 }
 
 static const char *
-novell_list_icon(GaimAccount * account, GaimBuddy * buddy)
+novell_list_icon(PurpleAccount * account, PurpleBuddy * buddy)
 {
 	return "novell";
 }
 
 static void
-novell_tooltip_text(GaimBuddy * buddy, GaimNotifyUserInfo * user_info, gboolean full)
+novell_tooltip_text(PurpleBuddy * buddy, PurpleNotifyUserInfo * user_info, gboolean full)
 {
 	NMUserRecord *user_record = NULL;
-	GaimConnection *gc;
+	PurpleConnection *gc;
 	NMUser *user;
 	int status = 0;
 	const char *status_str = NULL;
@@ -2802,11 +2802,11 @@
 	if (buddy == NULL)
 		return; 
 
-	gc = gaim_account_get_connection(buddy->account);
+	gc = purple_account_get_connection(buddy->account);
 	if (gc == NULL || (user = gc->proto_data) == NULL)
 		return;
 
-	if (GAIM_BUDDY_IS_ONLINE(buddy)) {
+	if (PURPLE_BUDDY_IS_ONLINE(buddy)) {
 		user_record = nm_find_user_record(user, buddy->name);
 		if (user_record) {
 			status = nm_user_record_get_status(user_record);
@@ -2833,21 +2833,21 @@
 					break;
 			}
 
-			gaim_notify_user_info_add_pair(user_info, _("Status"), status_str);
+			purple_notify_user_info_add_pair(user_info, _("Status"), status_str);
 			
 			if (text)
-				gaim_notify_user_info_add_pair(user_info, _("Message"), text);
+				purple_notify_user_info_add_pair(user_info, _("Message"), text);
 		}
 	}
 }
 
 static void
-novell_set_idle(GaimConnection * gc, int time)
+novell_set_idle(PurpleConnection * gc, int time)
 {
 	NMUser *user;
 	NMERR_T rc = NM_OK;
 	const char *id = NULL;
-	GaimStatus *status = NULL;
+	PurpleStatus *status = NULL;
 
 	if (gc == NULL)
 		return;
@@ -2856,8 +2856,8 @@
 	if (user == NULL)
 		return;
 
-	status = gaim_account_get_active_status(gaim_connection_get_account(gc));
-	id = gaim_status_get_id(status);
+	status = purple_account_get_active_status(purple_connection_get_account(gc));
+	id = purple_status_get_id(status);
 
 	/* Only go idle if active status is available  */
 	if (!strcmp(id, NOVELL_STATUS_TYPE_AVAILABLE)) {
@@ -2872,7 +2872,7 @@
 }
 
 static void
-novell_get_info(GaimConnection * gc, const char *name)
+novell_get_info(PurpleConnection * gc, const char *name)
 {
 	NMUserRecord *user_record;
 	NMUser *user;
@@ -2902,13 +2902,13 @@
 }
 
 static char *
-novell_status_text(GaimBuddy * buddy)
+novell_status_text(PurpleBuddy * buddy)
 {
 	const char *text = NULL;
 	const char *dn = NULL;
 
 	if (buddy && buddy->account) {
-		GaimConnection *gc = gaim_account_get_connection(buddy->account);
+		PurpleConnection *gc = purple_account_get_connection(buddy->account);
 
 		if (gc && gc->proto_data) {
 			NMUser *user = gc->proto_data;
@@ -2930,100 +2930,100 @@
 }
 
 static GList *
-novell_status_types(GaimAccount *account)
+novell_status_types(PurpleAccount *account)
 {
 	GList *status_types = NULL;
-	GaimStatusType *type;
+	PurpleStatusType *type;
 
 	g_return_val_if_fail(account != NULL, NULL);
 
-	type = gaim_status_type_new_with_attrs(GAIM_STATUS_AVAILABLE, NOVELL_STATUS_TYPE_AVAILABLE,
+	type = purple_status_type_new_with_attrs(PURPLE_STATUS_AVAILABLE, NOVELL_STATUS_TYPE_AVAILABLE,
 										   NULL, TRUE, TRUE, FALSE,
-										   "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING),
+										   "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING),
 										   NULL);
 	status_types = g_list_append(status_types, type);
 
-	type = gaim_status_type_new_with_attrs(GAIM_STATUS_AWAY, NOVELL_STATUS_TYPE_AWAY,
+	type = purple_status_type_new_with_attrs(PURPLE_STATUS_AWAY, NOVELL_STATUS_TYPE_AWAY,
 										   NULL, TRUE, TRUE, FALSE,
-										   "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING),
+										   "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING),
 										   NULL);
 	status_types = g_list_append(status_types, type);
 
-	type = gaim_status_type_new_with_attrs(GAIM_STATUS_UNAVAILABLE, NOVELL_STATUS_TYPE_BUSY,
+	type = purple_status_type_new_with_attrs(PURPLE_STATUS_UNAVAILABLE, NOVELL_STATUS_TYPE_BUSY,
 										   _("Busy"), TRUE, TRUE, FALSE,
-										   "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING),
+										   "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING),
 										   NULL);
 	status_types = g_list_append(status_types, type);
 
-	type = gaim_status_type_new_full(GAIM_STATUS_INVISIBLE, NOVELL_STATUS_TYPE_APPEAR_OFFLINE,
+	type = purple_status_type_new_full(PURPLE_STATUS_INVISIBLE, NOVELL_STATUS_TYPE_APPEAR_OFFLINE,
 										   NULL, TRUE, TRUE, FALSE);
 	status_types = g_list_append(status_types, type);
 
-	type = gaim_status_type_new_full(GAIM_STATUS_OFFLINE, NULL, NULL, FALSE, TRUE, FALSE);
+	type = purple_status_type_new_full(PURPLE_STATUS_OFFLINE, NULL, NULL, FALSE, TRUE, FALSE);
 	status_types = g_list_append(status_types, type);
 
 	return status_types;
 }
 
 static void
-novell_set_status(GaimAccount *account, GaimStatus *status)
+novell_set_status(PurpleAccount *account, PurpleStatus *status)
 {
-	GaimConnection *gc;
+	PurpleConnection *gc;
 	gboolean connected;
-	GaimPresence *presence;
-	GaimStatusType *type;
-	GaimStatusPrimitive primitive;
+	PurplePresence *presence;
+	PurpleStatusType *type;
+	PurpleStatusPrimitive primitive;
 	NMUser *user;
 	NMSTATUS_T novellstatus = NM_STATUS_AVAILABLE;
 	NMERR_T rc = NM_OK;
 	const char *msg = NULL;
 	char *text = NULL;
 
-	connected = gaim_account_is_connected(account);
-	presence = gaim_status_get_presence(status);
-	type = gaim_status_get_type(status);
-	primitive = gaim_status_type_get_primitive(type);
+	connected = purple_account_is_connected(account);
+	presence = purple_status_get_presence(status);
+	type = purple_status_get_type(status);
+	primitive = purple_status_type_get_primitive(type);
 
 	/*
 	 * We don't have any independent statuses, so we don't need to
 	 * do anything when a status is deactivated (because another
 	 * status is about to be activated).
 	 */
-	if (!gaim_status_is_active(status))
+	if (!purple_status_is_active(status))
 		return;
 
 	if (!connected)
 		return;
 
-	gc = gaim_account_get_connection(account);
+	gc = purple_account_get_connection(account);
 	user = gc->proto_data;
 	if (user == NULL)
 		return;
 
-	if (primitive == GAIM_STATUS_AVAILABLE) {
+	if (primitive == PURPLE_STATUS_AVAILABLE) {
 		novellstatus = NM_STATUS_AVAILABLE;
-	} else if (primitive == GAIM_STATUS_AWAY) {
+	} else if (primitive == PURPLE_STATUS_AWAY) {
 		novellstatus = NM_STATUS_AWAY;
-	} else if (primitive == GAIM_STATUS_UNAVAILABLE) {
+	} else if (primitive == PURPLE_STATUS_UNAVAILABLE) {
 		novellstatus = NM_STATUS_BUSY;
-	} else if (primitive == GAIM_STATUS_INVISIBLE) {
+	} else if (primitive == PURPLE_STATUS_INVISIBLE) {
 		novellstatus = NM_STATUS_OFFLINE;
-	} else if (gaim_presence_is_idle(presence)) {
+	} else if (purple_presence_is_idle(presence)) {
 		novellstatus = NM_STATUS_AWAY_IDLE;
 	} else {
 		novellstatus = NM_STATUS_AVAILABLE;
 	}
 
-	if (primitive == GAIM_STATUS_AWAY || primitive == GAIM_STATUS_AVAILABLE ||
-		primitive == GAIM_STATUS_UNAVAILABLE) {
-		msg = gaim_status_get_attr_string(status, "message");
+	if (primitive == PURPLE_STATUS_AWAY || primitive == PURPLE_STATUS_AVAILABLE ||
+		primitive == PURPLE_STATUS_UNAVAILABLE) {
+		msg = purple_status_get_attr_string(status, "message");
 		text = g_strdup(msg);
 
-		if (primitive == GAIM_STATUS_AVAILABLE)
+		if (primitive == PURPLE_STATUS_AVAILABLE)
 			msg = NULL; /* no auto replies for online status */
 
 		/* Don't want newlines in status text */
-		gaim_util_chrreplace(text, '\n', ' ');
+		purple_util_chrreplace(text, '\n', ' ');
 	}
 
 	rc = nm_send_set_status(user, novellstatus, text, msg, NULL, NULL);
@@ -3034,7 +3034,7 @@
 }
 
 static void
-novell_add_permit(GaimConnection *gc, const char *who)
+novell_add_permit(PurpleConnection *gc, const char *who)
 {
 	NMUser *user;
 	NMERR_T rc = NM_OK;
@@ -3050,7 +3050,7 @@
 	/* Remove first -- we will add it back in when we get
 	 * the okay from the server
 	 */
-	gaim_privacy_permit_remove(gc->account, who, TRUE);
+	purple_privacy_permit_remove(gc->account, who, TRUE);
 
 	if (nm_user_is_privacy_locked(user)) {
 		_show_privacy_locked_error(gc, user);
@@ -3078,7 +3078,7 @@
 }
 
 static void
-novell_add_deny(GaimConnection *gc, const char *who)
+novell_add_deny(PurpleConnection *gc, const char *who)
 {
 	NMUser *user;
 	NMERR_T rc = NM_OK;
@@ -3094,7 +3094,7 @@
 	/* Remove first -- we will add it back in when we get
 	 * the okay from the server
 	 */
-	gaim_privacy_deny_remove(gc->account, who, TRUE);
+	purple_privacy_deny_remove(gc->account, who, TRUE);
 
 	if (nm_user_is_privacy_locked(user)) {
 		_show_privacy_locked_error(gc, user);
@@ -3122,7 +3122,7 @@
 }
 
 static void
-novell_rem_permit(GaimConnection *gc, const char *who)
+novell_rem_permit(PurpleConnection *gc, const char *who)
 {
 	NMUser *user;
 	NMERR_T rc = NM_OK;
@@ -3152,7 +3152,7 @@
 }
 
 static void
-novell_rem_deny(GaimConnection *gc, const char *who)
+novell_rem_deny(PurpleConnection *gc, const char *who)
 {
 	NMUser *user;
 	NMERR_T rc = NM_OK;
@@ -3182,7 +3182,7 @@
 }
 
 static void
-novell_set_permit_deny(GaimConnection *gc)
+novell_set_permit_deny(PurpleConnection *gc)
 {
 	NMERR_T rc = NM_OK;
 	const char *dn, *name = NULL;
@@ -3214,7 +3214,7 @@
 
 	switch (gc->account->perm_deny) {
 
-		case GAIM_PRIVACY_ALLOW_ALL:
+		case PURPLE_PRIVACY_ALLOW_ALL:
 			rc = nm_send_set_privacy_default(user, FALSE,
 											 _set_privacy_default_resp_cb, NULL);
 			_check_for_disconnect(user, rc);
@@ -3234,7 +3234,7 @@
 			}
 			break;
 
-		case GAIM_PRIVACY_DENY_ALL:
+		case PURPLE_PRIVACY_DENY_ALL:
 			rc = nm_send_set_privacy_default(user, TRUE,
 											 _set_privacy_default_resp_cb, NULL);
 			_check_for_disconnect(user, rc);
@@ -3254,7 +3254,7 @@
 			}
 			break;
 
-		case GAIM_PRIVACY_ALLOW_USERS:
+		case PURPLE_PRIVACY_ALLOW_USERS:
 
 			rc = nm_send_set_privacy_default(user, TRUE,
 											 _set_privacy_default_resp_cb, NULL);
@@ -3270,7 +3270,7 @@
 
 						if (!g_slist_find_custom(gc->account->permit,
 												 name, (GCompareFunc)nm_utf8_strcasecmp)) {
-							gaim_privacy_permit_add(gc->account, name , TRUE);
+							purple_privacy_permit_add(gc->account, name , TRUE);
 						}
 					}
 				}
@@ -3289,13 +3289,13 @@
 															 g_strdup(dn));
 						}
 					} else {
-						gaim_privacy_permit_remove(gc->account, (char *)node->data, TRUE);
+						purple_privacy_permit_remove(gc->account, (char *)node->data, TRUE);
 					}
 				}
 			}
 			break;
 
-		case GAIM_PRIVACY_DENY_USERS:
+		case PURPLE_PRIVACY_DENY_USERS:
 
 			/* set to default allow */
 			rc = nm_send_set_privacy_default(user, FALSE,
@@ -3312,7 +3312,7 @@
 
 						if (!g_slist_find_custom(gc->account->deny,
 												 name, (GCompareFunc)nm_utf8_strcasecmp)) {
-							gaim_privacy_deny_add(gc->account, name , TRUE);
+							purple_privacy_deny_add(gc->account, name , TRUE);
 						}
 					}
 				}
@@ -3332,14 +3332,14 @@
 															 g_strdup(name));
 						}
 					} else {
-						gaim_privacy_deny_remove(gc->account, (char *)node->data, TRUE);
+						purple_privacy_deny_remove(gc->account, (char *)node->data, TRUE);
 					}
 				}
 
 			}
 			break;
 
-		case GAIM_PRIVACY_ALLOW_BUDDYLIST:
+		case PURPLE_PRIVACY_ALLOW_BUDDYLIST:
 
 			/* remove users from allow list that are not in buddy list */
 			copy = g_slist_copy(user->allow_list);
@@ -3400,14 +3400,14 @@
 }
 
 static GList *
-novell_blist_node_menu(GaimBlistNode *node)
+novell_blist_node_menu(PurpleBlistNode *node)
 {
 	GList *list = NULL;
-	GaimMenuAction *act;
-
-	if(GAIM_BLIST_NODE_IS_BUDDY(node)) {
-		act = gaim_menu_action_new(_("Initiate _Chat"),
-		                           GAIM_CALLBACK(_initiate_conference_cb),
+	PurpleMenuAction *act;
+
+	if(PURPLE_BLIST_NODE_IS_BUDDY(node)) {
+		act = purple_menu_action_new(_("Initiate _Chat"),
+		                           PURPLE_CALLBACK(_initiate_conference_cb),
 		                           NULL, NULL);
 		list = g_list_append(list, act);
 	}
@@ -3416,7 +3416,7 @@
 }
 
 static void
-novell_keepalive(GaimConnection *gc)
+novell_keepalive(PurpleConnection *gc)
 {
 	NMUser *user;
 	NMERR_T rc = NM_OK;
@@ -3432,7 +3432,7 @@
 	_check_for_disconnect(user, rc);
 }
 
-static GaimPluginProtocolInfo prpl_info = {
+static PurplePluginProtocolInfo prpl_info = {
 	0,
 	NULL,						/* user_splits */
 	NULL,						/* protocol_options */
@@ -3479,7 +3479,7 @@
 	novell_rename_group,		/* rename_group */
 	NULL,						/* buddy_free */
 	novell_convo_closed,		/* convo_closed */
-	gaim_normalize_nocase,		/* normalize */
+	purple_normalize_nocase,		/* normalize */
 	NULL,						/* set_buddy_icon */
 	novell_remove_group,		/* remove_group */
 	NULL,						/* get_cb_real_name */
@@ -3498,15 +3498,15 @@
 
 };
 
-static GaimPluginInfo info = {
-	GAIM_PLUGIN_MAGIC,
-	GAIM_MAJOR_VERSION,
-	GAIM_MINOR_VERSION,
-	GAIM_PLUGIN_PROTOCOL,			/**< type           */
+static PurplePluginInfo info = {
+	PURPLE_PLUGIN_MAGIC,
+	PURPLE_MAJOR_VERSION,
+	PURPLE_MINOR_VERSION,
+	PURPLE_PLUGIN_PROTOCOL,			/**< type           */
 	NULL,					/**< ui_requirement */
 	0,					/**< flags          */
 	NULL,					/**< dependencies   */
-	GAIM_PRIORITY_DEFAULT,			/**< priority       */
+	PURPLE_PRIORITY_DEFAULT,			/**< priority       */
 	"prpl-novell",				/**< id             */
 	"GroupWise",				/**< name           */
 	VERSION,				/**< version        */
@@ -3515,7 +3515,7 @@
 	/**  description    */
 	N_("Novell GroupWise Messenger Protocol Plugin"),
 	NULL,					/**< author         */
-	GAIM_WEBSITE,				/**< homepage       */
+	PURPLE_WEBSITE,				/**< homepage       */
 
 	NULL,					/**< load           */
 	NULL,					/**< unload         */
@@ -3528,19 +3528,19 @@
 };
 
 static void
-init_plugin(GaimPlugin * plugin)
+init_plugin(PurplePlugin * plugin)
 {
-	GaimAccountOption *option;
-
-	option = gaim_account_option_string_new(_("Server address"), "server", NULL);
+	PurpleAccountOption *option;
+
+	option = purple_account_option_string_new(_("Server address"), "server", NULL);
 	prpl_info.protocol_options =
 		g_list_append(prpl_info.protocol_options, option);
 
-	option = gaim_account_option_int_new(_("Server port"), "port", DEFAULT_PORT);
+	option = purple_account_option_int_new(_("Server port"), "port", DEFAULT_PORT);
 	prpl_info.protocol_options =
 		g_list_append(prpl_info.protocol_options, option);
 
 	my_protocol = plugin;
 }
 
-GAIM_INIT_PLUGIN(novell, init_plugin, info);
+PURPLE_INIT_PLUGIN(novell, init_plugin, info);