# HG changeset patch
# Node ID 00be838e6ace
# Parent  af2ef331418f
diff --git a/ChangeLog.API b/ChangeLog.API
--- a/ChangeLog.API
+++ b/ChangeLog.API
@@ -674,6 +674,8 @@
 		* purple_serv_add_deny
 		* purple_serv_add_permit
 		* purple_serv_get_info
+		* purple_serv_got_join_chat_failed
+		* purple_serv_got_private_alias
 		* purple_serv_remove_deny
 		* purple_serv_remove_permit
 		* purple_serv_set_info
diff --git a/libpurple/connection.c b/libpurple/connection.c
--- a/libpurple/connection.c
+++ b/libpurple/connection.c
@@ -389,19 +389,6 @@
 }
 
 void
-_purple_connection_add_active_chat(PurpleConnection *connection,
-                                   PurpleChatConversation *chat)
-{
-	PurpleConnectionPrivate *priv = NULL;
-
-	g_return_if_fail(PURPLE_IS_CONNECTION(connection));
-
-	priv = purple_connection_get_instance_private(connection);
-
-	priv->active_chats = g_slist_append(priv->active_chats, chat);
-}
-
-void
 _purple_connection_remove_active_chat(PurpleConnection *connection,
                                       PurpleChatConversation *chat)
 {
diff --git a/libpurple/protocols.h b/libpurple/protocols.h
--- a/libpurple/protocols.h
+++ b/libpurple/protocols.h
@@ -43,78 +43,6 @@
 /**************************************************************************/
 
 /**
- * purple_protocol_got_user_idle:
- * @account:   The account the user is on.
- * @name:      The name of the buddy.
- * @idle:      The user's idle state.
- * @idle_time: The user's idle time.  This is the time at
- *                  which the user became idle, in seconds since
- *                  the epoch.  If the protocol does not know this value
- *                  then it should pass 0.
- *
- * Notifies Purple that a buddy's idle state and time have changed.
- *
- * This is meant to be called from protocols.
- *
- * Since: 3.0
- */
-PURPLE_AVAILABLE_IN_3_0
-void purple_protocol_got_user_idle(PurpleAccount *account, const char *name,
-                                   gboolean idle, time_t idle_time);
-
-/**
- * purple_protocol_got_user_status:
- * @account: The account the user is on.
- * @name: The name of the buddy.
- * @status_id: The status ID.
- * @...: A NULL-terminated list of attribute IDs and values.
- *
- * Notifies Purple that a buddy's status has been activated.
- *
- * This is meant to be called from protocols.
- *
- * Since: 3.0
- */
-PURPLE_AVAILABLE_IN_3_0
-void purple_protocol_got_user_status(PurpleAccount *account, const char *name,
-                                     const char *status_id, ...)
-                                     G_GNUC_NULL_TERMINATED;
-
-/**
- * purple_protocol_got_user_status_with_attributes: (rename-to purple_protocol_got_user_status):
- * @account: The account the user is on.
- * @name: The name of the buddy.
- * @status_id: The status ID.
- * @attributes: (element-type utf8 gpointer): A hash table of attribute IDs and
- *              their corresponding values.
- *
- * Notifies Purple that a buddy's status has been activated.
- *
- * This is meant to be called from protocols.
- *
- * Since: 3.0
- */
-PURPLE_AVAILABLE_IN_3_0
-void purple_protocol_got_user_status_with_attributes(PurpleAccount *account, const gchar *name, const gchar *status_id, GHashTable *attributes);
-
-/**
- * purple_protocol_got_user_status_deactive:
- * @account:   The account the user is on.
- * @name:      The name of the buddy.
- * @status_id: The status ID.
- *
- * Notifies libpurple that a buddy's status has been deactivated
- *
- * This is meant to be called from protocols.
- *
- * Since: 3.0
- */
-PURPLE_AVAILABLE_IN_3_0
-void purple_protocol_got_user_status_deactive(PurpleAccount *account,
-                                              const char *name,
-                                              const char *status_id);
-
-/**
  * purple_protocol_change_account_status:
  * @account:    The account the user is on.
  * @old_status: The previous status.
@@ -145,53 +73,6 @@
 GList *purple_protocol_get_statuses(PurpleAccount *account,
                                     PurplePresence *presence);
 
-/**
- * purple_protocol_get_media_caps:
- * @account: The account the user is on.
- * @who: The name of the contact to check capabilities for.
- *
- * Determines if the contact supports the given media session type.
- *
- * Returns: The media caps the contact supports.
- *
- * Since: 3.0
- */
-PURPLE_AVAILABLE_IN_3_0
-PurpleMediaCaps purple_protocol_get_media_caps(PurpleAccount *account,
-                                               const char *who);
-
-/**
- * purple_protocol_initiate_media:
- * @account: The account the user is on.
- * @who: The name of the contact to start a session with.
- * @type: The type of media session to start.
- *
- * Initiates a media session with the given contact.
- *
- * Returns: TRUE if the call succeeded else FALSE. (Doesn't imply the media
- *          session or stream will be successfully created)
- *
- * Since: 3.0
- */
-PURPLE_AVAILABLE_IN_3_0
-gboolean purple_protocol_initiate_media(PurpleAccount *account,
-                                        const char *who,
-                                        PurpleMediaSessionType type);
-
-/**
- * purple_protocol_got_media_caps:
- * @account: The account the user is on.
- * @who: The name of the contact for which capabilities have been received.
- *
- * Signals that the protocol received capabilities for the given contact.
- *
- * This function is intended to be used only by protocols.
- *
- * Since: 3.0
- */
-PURPLE_AVAILABLE_IN_3_0
-void purple_protocol_got_media_caps(PurpleAccount *account, const char *who);
-
 G_END_DECLS
 
 #endif /* PURPLE_PROTOCOLS_H */
diff --git a/libpurple/protocols.c b/libpurple/protocols.c
--- a/libpurple/protocols.c
+++ b/libpurple/protocols.c
@@ -43,133 +43,6 @@
 /**************************************************************************/
 /* Protocol API                                                           */
 /**************************************************************************/
-void
-purple_protocol_got_user_idle(PurpleAccount *account, const char *name,
-		gboolean idle, time_t idle_time)
-{
-	PurplePresence *presence;
-	GSList *list;
-	GDateTime *idle_date_time = NULL;
-
-	g_return_if_fail(account != NULL);
-	g_return_if_fail(name    != NULL);
-	g_return_if_fail(purple_account_is_connected(account) || purple_account_is_connecting(account));
-
-	if ((list = purple_blist_find_buddies(account, name)) == NULL)
-		return;
-
-	idle_date_time = g_date_time_new_from_unix_local(idle_time);
-	while (list) {
-		presence = purple_buddy_get_presence(list->data);
-		list = g_slist_delete_link(list, list);
-		purple_presence_set_idle(presence, idle, idle_date_time);
-	}
-	g_date_time_unref(idle_date_time);
-}
-
-void
-purple_protocol_got_user_status_with_attributes(PurpleAccount *account,
-                                                const gchar *name,
-                                                const gchar *status_id,
-                                                GHashTable *attributes)
-{
-	GSList *list, *l;
-	PurpleBuddy *buddy;
-	PurplePresence *presence;
-	PurpleStatus *status;
-	PurpleStatus *old_status;
-
-	g_return_if_fail(account   != NULL);
-	g_return_if_fail(name      != NULL);
-	g_return_if_fail(status_id != NULL);
-	g_return_if_fail(purple_account_is_connected(account) || purple_account_is_connecting(account));
-
-	if((list = purple_blist_find_buddies(account, name)) == NULL) {
-		return;
-	}
-
-	for(l = list; l != NULL; l = l->next) {
-		buddy = l->data;
-
-		presence = purple_buddy_get_presence(buddy);
-		status = purple_presence_get_status(presence, status_id);
-
-		if(NULL == status) {
-			/*
-			 * TODO: This should never happen, right?  We should call
-			 *       g_warning() or something.
-			 */
-			continue;
-		}
-
-		old_status = purple_presence_get_active_status(presence);
-
-		purple_status_set_active_with_attributes(status, TRUE, attributes);
-
-		purple_buddy_update_status(buddy, old_status);
-	}
-
-	g_slist_free(list);
-
-	/* The buddy is no longer online, they are therefore by definition not
-	 * still typing to us. */
-	if (!purple_status_is_online(status)) {
-		purple_serv_got_typing_stopped(purple_account_get_connection(account), name);
-		purple_protocol_got_media_caps(account, name);
-	}
-}
-
-void
-purple_protocol_got_user_status(PurpleAccount *account, const gchar *name,
-                                const gchar *status_id, ...)
-{
-	GHashTable *attributes = NULL;
-	va_list args;
-
-	va_start(args, status_id);
-	attributes = purple_attrs_from_vargs(args);
-	va_end(args);
-
-	purple_protocol_got_user_status_with_attributes(account, name, status_id,
-	                                                attributes);
-
-	g_hash_table_destroy(attributes);
-}
-
-void purple_protocol_got_user_status_deactive(PurpleAccount *account, const char *name,
-					const char *status_id)
-{
-	GSList *list, *l;
-	PurpleBuddy *buddy;
-	PurplePresence *presence;
-	PurpleStatus *status;
-
-	g_return_if_fail(account   != NULL);
-	g_return_if_fail(name      != NULL);
-	g_return_if_fail(status_id != NULL);
-	g_return_if_fail(purple_account_is_connected(account) || purple_account_is_connecting(account));
-
-	if((list = purple_blist_find_buddies(account, name)) == NULL)
-		return;
-
-	for(l = list; l != NULL; l = l->next) {
-		buddy = l->data;
-
-		presence = purple_buddy_get_presence(buddy);
-		status   = purple_presence_get_status(presence, status_id);
-
-		if(NULL == status)
-			continue;
-
-		if (purple_status_is_active(status)) {
-			purple_status_set_active(status, FALSE);
-			purple_buddy_update_status(buddy, status);
-		}
-	}
-
-	g_slist_free(list);
-}
-
 static void
 do_protocol_change_account_status(PurpleAccount *account,
                                   G_GNUC_UNUSED PurpleStatus *old_status,
@@ -248,80 +121,3 @@
 	return g_list_copy_deep(purple_account_get_status_types(account),
 	                        (GCopyFunc)purple_status_new, presence);
 }
-
-gboolean
-purple_protocol_initiate_media(PurpleAccount *account,
-			   const char *who,
-			   PurpleMediaSessionType type)
-{
-	PurpleConnection *gc = NULL;
-	PurpleProtocol *protocol = NULL;
-
-	if(account) {
-		gc = purple_account_get_connection(account);
-	}
-	if(gc) {
-		protocol = purple_connection_get_protocol(gc);
-	}
-
-	if(PURPLE_IS_PROTOCOL_MEDIA(protocol)) {
-		PurpleProtocolMedia *media = PURPLE_PROTOCOL_MEDIA(protocol);
-
-		return purple_protocol_media_initiate_session(media, account, who,
-		                                              type);
-	} else {
-		return FALSE;
-	}
-}
-
-PurpleMediaCaps
-purple_protocol_get_media_caps(PurpleAccount *account, const char *who)
-{
-	PurpleConnection *gc = NULL;
-	PurpleProtocol *protocol = NULL;
-
-	if(account) {
-		gc = purple_account_get_connection(account);
-	}
-	if(gc) {
-		protocol = purple_connection_get_protocol(gc);
-	}
-
-	if(PURPLE_IS_PROTOCOL_MEDIA(protocol)) {
-		return purple_protocol_media_get_caps(PURPLE_PROTOCOL_MEDIA(protocol),
-		                                      account, who);
-	} else {
-		return PURPLE_MEDIA_CAPS_NONE;
-	}
-}
-
-void
-purple_protocol_got_media_caps(PurpleAccount *account, const char *name)
-{
-	GSList *list;
-
-	g_return_if_fail(account != NULL);
-	g_return_if_fail(name    != NULL);
-
-	if ((list = purple_blist_find_buddies(account, name)) == NULL)
-		return;
-
-	while (list) {
-		PurpleBuddy *buddy = list->data;
-		PurpleMediaCaps oldcaps = purple_buddy_get_media_caps(buddy);
-		PurpleMediaCaps newcaps = 0;
-		const gchar *bname = purple_buddy_get_name(buddy);
-		list = g_slist_delete_link(list, list);
-
-
-		newcaps = purple_protocol_get_media_caps(account, bname);
-		purple_buddy_set_media_caps(buddy, newcaps);
-
-		if (oldcaps == newcaps)
-			continue;
-
-		purple_signal_emit(purple_blist_get_handle(),
-				"buddy-caps-changed", buddy,
-				newcaps, oldcaps);
-	}
-}
diff --git a/libpurple/purpleprivate.h b/libpurple/purpleprivate.h
--- a/libpurple/purpleprivate.h
+++ b/libpurple/purpleprivate.h
@@ -83,19 +83,6 @@
 gboolean _purple_connection_wants_to_die(PurpleConnection *gc);
 
 /**
- * _purple_connection_add_active_chat:
- * @gc:    The connection
- * @chat:  The chat conversation to add
- *
- * Adds a chat to the active chats list of a connection
- *
- * Note: This function should only be called by purple_serv_got_joined_chat()
- *       in server.c.
- */
-G_GNUC_INTERNAL
-void _purple_connection_add_active_chat(PurpleConnection *gc, PurpleChatConversation *chat);
-
-/**
  * _purple_connection_remove_active_chat:
  * @gc:    The connection
  * @chat:  The chat conversation to remove
diff --git a/libpurple/server.h b/libpurple/server.h
--- a/libpurple/server.h
+++ b/libpurple/server.h
@@ -143,83 +143,6 @@
  *****************************************************************************/
 
 /**
- * purple_serv_alias_buddy:
- * @buddy:  The Buddy.
- *
- * Save/store buddy's alias on server list/roster
- *
- * Since: 3.0
- */
-PURPLE_AVAILABLE_IN_3_0
-void purple_serv_alias_buddy(PurpleBuddy *buddy);
-
-/**
- * purple_serv_got_alias:
- * @gc:     The connection over which to send the typing notification.
- * @who: The name of the buddy whose alias was received.
- * @alias: The alias that was received.
- *
- * Protocol should call this function when it retrieves an alias form the server.
- *
- * Since: 3.0
- */
-PURPLE_AVAILABLE_IN_3_0
-void purple_serv_got_alias(PurpleConnection *gc, const char *who, const char *alias);
-
-/**
- * purple_serv_got_private_alias:
- * @gc: The connection on which the alias was received.
- * @who: The name of the buddy whose alias was received.
- * @alias: The alias that was received.
- *
- * A protocol should call this when it retrieves a private alias from
- * the server.  Private aliases are the aliases the user sets, while public
- * aliases are the aliases or display names that buddies set for themselves.
- *
- * Since: 2.4
- */
-PURPLE_AVAILABLE_IN_2_4
-void purple_serv_got_private_alias(PurpleConnection *gc, const char *who, const char *alias);
-
-
-/**
- * purple_serv_got_typing:
- * @gc:      The connection on which the typing message was received.
- * @name:    The name of the remote user.
- * @timeout: If this is a number greater than 0, then
- *        Purple will wait this number of seconds and then
- *        set this buddy to the PURPLE_IM_NOT_TYPING state.  This
- *        is used by protocols that send repeated typing messages
- *        while the user is composing the message.
- * @state:   The typing state received
- *
- * Receive a typing message from a remote user.  Either PURPLE_IM_TYPING
- * or PURPLE_IM_TYPED.  If the user has stopped typing then use
- * purple_serv_got_typing_stopped instead.
- *
- * @todo Could probably move this into the conversation API.
- *
- * Since: 3.0
- */
-PURPLE_AVAILABLE_IN_3_0
-void purple_serv_got_typing(PurpleConnection *gc, const char *name, int timeout,
-					 PurpleIMTypingState state);
-
-/**
- * purple_serv_got_typing_stopped:
- * @gc: The #PurpleConnection
- * @name: The name of the person that stopped typing.
- *
- * Called from a protocol when it has received a type stopped.
- *
- * @todo Could probably move this into the conversation API.
- *
- * Since: 3.0
- */
-PURPLE_AVAILABLE_IN_3_0
-void purple_serv_got_typing_stopped(PurpleConnection *gc, const char *name);
-
-/**
  * purple_serv_got_im:
  * @gc:     The connection on which the typing message was received.
  * @who:    The username of the buddy that sent the message.
@@ -249,69 +172,6 @@
 void purple_serv_join_chat(PurpleConnection *gc, GHashTable *data);
 
 /**
- * purple_serv_reject_chat:
- * @gc: The #PurpleConnection
- * @data: The hash function should be g_str_hash() and the equal
- *             function should be g_str_equal().
- *
- * Rejects a chat invite based on the components in @data.
- *
- * Since: 3.0
- */
-PURPLE_AVAILABLE_IN_3_0
-void purple_serv_reject_chat(PurpleConnection *gc, GHashTable *data);
-
-/**
- * purple_serv_got_chat_invite:
- * @gc:      The connection on which the invite arrived.
- * @name:    The name of the chat you're being invited to.
- * @who:     The username of the person inviting the account.
- * @message: The optional invite message.
- * @data:    The components necessary if you want to call purple_serv_join_chat().
- *                The hash function should be g_str_hash() and the equal
- *                function should be g_str_equal().
- *
- * Called by a protocol when an account is invited into a chat.
- *
- * Since: 3.0
- */
-PURPLE_AVAILABLE_IN_3_0
-void purple_serv_got_chat_invite(PurpleConnection *gc, const char *name,
-						  const char *who, const char *message,
-						  GHashTable *data);
-
-/**
- * purple_serv_got_joined_chat:
- * @gc:   The connection on which the chat was joined.
- * @id:   The id of the chat, assigned by the protocol.
- * @name: The name of the chat.
- *
- * Called by a protocol when an account has joined a chat.
- *
- * Returns: (transfer none): The resulting conversation.
- *
- * Since: 3.0
- */
-PURPLE_AVAILABLE_IN_3_0
-PurpleConversation *purple_serv_got_joined_chat(PurpleConnection *gc,
-									   int id, const char *name);
-
-/**
- * purple_serv_got_join_chat_failed:
- * @gc:      The connection on which chat joining failed
- * @data:    The components passed to purple_serv_join_chat() originally.
- *                The hash function should be g_str_hash() and the equal
- *                function should be g_str_equal().
- *
- * Called by a protocol when an attempt to join a chat via purple_serv_join_chat()
- * fails.
- *
- * Since: 2.5
- */
-PURPLE_AVAILABLE_IN_2_5
-void purple_serv_got_join_chat_failed(PurpleConnection *gc, GHashTable *data);
-
-/**
  * purple_serv_got_chat_left:
  * @g:  The connection on which the chat was left.
  * @id: The id of the chat, as assigned by the protocol.
@@ -323,36 +183,6 @@
 PURPLE_AVAILABLE_IN_3_0
 void purple_serv_got_chat_left(PurpleConnection *g, int id);
 
-/**
- * purple_serv_got_chat_in:
- * @g:       The connection on which the message was received.
- * @id:      The id of the chat, as assigned by the protocol.
- * @who:     The name of the user who sent the message.
- * @flags:   The flags of the message.
- * @message: The message received in the chat.
- * @mtime:   The time when the message was received.
- *
- * Called by a protocol when a message has been received in a chat.
- *
- * Since: 3.0
- */
-PURPLE_AVAILABLE_IN_3_0
-void purple_serv_got_chat_in(PurpleConnection *g, int id, const char *who,
-					  PurpleMessageFlags flags, const char *message, time_t mtime);
-
-/**
- * purple_serv_send_file:
- * @gc:     The connection on which the message was received.
- * @who:    The name of the user to who send the file.
- * @file:   The filename to send.
- *
- * Send a filename to a given contact.
- *
- * Since: 3.0
- */
-PURPLE_AVAILABLE_IN_3_0
-void purple_serv_send_file(PurpleConnection *gc, const char *who, const char *file);
-
 G_END_DECLS
 
 #endif /* PURPLE_SERVER_H */
diff --git a/libpurple/server.c b/libpurple/server.c
--- a/libpurple/server.c
+++ b/libpurple/server.c
@@ -96,104 +96,6 @@
 }
 
 /*
- * Set buddy's alias on server roster/list
- */
-void purple_serv_alias_buddy(PurpleBuddy *b)
-{
-	PurpleAccount *account;
-	PurpleConnection *gc;
-	PurpleProtocol *protocol;
-
-	if (b) {
-		account = purple_buddy_get_account(b);
-
-		if (account) {
-			gc = purple_account_get_connection(account);
-
-			if(gc) {
-				protocol = purple_connection_get_protocol(gc);
-				purple_protocol_server_alias_buddy(PURPLE_PROTOCOL_SERVER(protocol),
-				                                   gc,
-				                                   purple_buddy_get_name(b),
-				                                   purple_buddy_get_local_alias(b));
-			}
-		}
-	}
-}
-
-void
-purple_serv_got_alias(PurpleConnection *gc, const char *who, const char *alias)
-{
-	PurpleAccount *account;
-	PurpleBuddy *b;
-	PurpleConversation *im;
-	PurpleConversationManager *manager;
-	GSList *buddies;
-
-	account = purple_connection_get_account(gc);
-	buddies = purple_blist_find_buddies(account, who);
-
-	manager = purple_conversation_manager_get_default();
-
-	while (buddies != NULL)
-	{
-		const char *server_alias;
-
-		b = buddies->data;
-		buddies = g_slist_delete_link(buddies, buddies);
-
-		server_alias = purple_buddy_get_server_alias(b);
-
-		if (purple_strequal(server_alias, alias))
-			continue;
-
-		purple_buddy_set_server_alias(b, alias);
-
-		im = purple_conversation_manager_find_im(manager, account,
-		                                         purple_buddy_get_name(b));
-		if (im != NULL && alias != NULL && !purple_strequal(alias, who))
-		{
-			char *escaped = g_markup_escape_text(who, -1);
-			char *escaped2 = g_markup_escape_text(alias, -1);
-			char *tmp = g_strdup_printf(_("%s is now known as %s.\n"),
-										escaped, escaped2);
-
-			purple_conversation_write_system_message(
-				im, tmp,
-				PURPLE_MESSAGE_NO_LINKIFY);
-
-			g_free(tmp);
-			g_free(escaped2);
-			g_free(escaped);
-		}
-	}
-}
-
-void
-purple_serv_got_private_alias(PurpleConnection *gc, const char *who, const char *alias)
-{
-	PurpleAccount *account = NULL;
-	GSList *buddies = NULL;
-	PurpleBuddy *b = NULL;
-
-	account = purple_connection_get_account(gc);
-	buddies = purple_blist_find_buddies(account, who);
-
-	while(buddies != NULL) {
-		const char *balias;
-		b = buddies->data;
-
-		buddies = g_slist_delete_link(buddies, buddies);
-
-		balias = purple_buddy_get_local_alias(b);
-		if (purple_strequal(balias, alias))
-			continue;
-
-		purple_buddy_set_local_alias(b, alias);
-	}
-}
-
-/*
  * Move a buddy from one group to another on server.
  *
  * Note: For now we'll not deal with changing gc's at the same time, but
@@ -232,17 +134,6 @@
 	}
 }
 
-
-void purple_serv_reject_chat(PurpleConnection *gc, GHashTable *data)
-{
-	PurpleProtocol *protocol;
-
-	if (gc) {
-		protocol = purple_connection_get_protocol(gc);
-		purple_protocol_chat_reject(PURPLE_PROTOCOL_CHAT(protocol), gc, data);
-	}
-}
-
 void purple_serv_chat_invite(PurpleConnection *gc, int id, const char *message, const char *name)
 {
 	PurpleAccount *account;
@@ -394,175 +285,6 @@
 	g_free(name);
 }
 
-void
-purple_serv_got_typing(PurpleConnection *gc, const char *name, int timeout,
-                       PurpleIMTypingState state)
-{
-	PurpleAccount *account;
-	PurpleConversation *conv;
-	PurpleConversationManager *manager;
-
-	account = purple_connection_get_account(gc);
-
-	manager = purple_conversation_manager_get_default();
-	conv = purple_conversation_manager_find_im(manager, account, name);
-	if(PURPLE_IS_IM_CONVERSATION(conv)) {
-		PurpleIMConversation *im = PURPLE_IM_CONVERSATION(conv);
-
-		purple_im_conversation_set_typing_state(im, state);
-
-		if(timeout > 0) {
-			purple_im_conversation_start_typing_timeout(im, timeout);
-		}
-	} else {
-		switch (state)
-		{
-			case PURPLE_IM_TYPING:
-				purple_signal_emit(purple_conversations_get_handle(),
-								   "buddy-typing", account, name);
-				break;
-			case PURPLE_IM_TYPED:
-				purple_signal_emit(purple_conversations_get_handle(),
-								   "buddy-typed", account, name);
-				break;
-			case PURPLE_IM_NOT_TYPING:
-				purple_signal_emit(purple_conversations_get_handle(),
-								   "buddy-typing-stopped", account, name);
-				break;
-		}
-	}
-}
-
-void
-purple_serv_got_typing_stopped(PurpleConnection *gc, const char *name) {
-	PurpleAccount *account;
-	PurpleConversation *conv;
-	PurpleConversationManager *manager;
-
-	account = purple_connection_get_account(gc);
-
-	manager = purple_conversation_manager_get_default();
-	conv = purple_conversation_manager_find_im(manager, account, name);
-	if(conv != NULL) {
-		PurpleIMConversation *im = PURPLE_IM_CONVERSATION(conv);
-		if(purple_im_conversation_get_typing_state(im) == PURPLE_IM_NOT_TYPING) {
-			return;
-		}
-
-		purple_im_conversation_stop_typing_timeout(im);
-		purple_im_conversation_set_typing_state(im, PURPLE_IM_NOT_TYPING);
-	}
-	else
-	{
-		purple_signal_emit(purple_conversations_get_handle(),
-		                   "buddy-typing-stopped", account, name);
-	}
-}
-
-struct chat_invite_data {
-	PurpleConnection *gc;
-	GHashTable *components;
-};
-
-static void chat_invite_data_free(struct chat_invite_data *cid)
-{
-	g_clear_pointer(&cid->components, g_hash_table_destroy);
-	g_free(cid);
-}
-
-
-static void chat_invite_reject(struct chat_invite_data *cid)
-{
-	purple_serv_reject_chat(cid->gc, cid->components);
-	chat_invite_data_free(cid);
-}
-
-
-static void chat_invite_accept(struct chat_invite_data *cid)
-{
-	purple_serv_join_chat(cid->gc, cid->components);
-	chat_invite_data_free(cid);
-}
-
-
-
-void purple_serv_got_chat_invite(PurpleConnection *gc, const char *name,
-						  const char *who, const char *message, GHashTable *data)
-{
-	PurpleAccount *account;
-	PurpleContactInfo *info = NULL;
-	struct chat_invite_data *cid;
-	int plugin_return;
-
-	g_return_if_fail(name != NULL);
-	g_return_if_fail(who != NULL);
-
-	account = purple_connection_get_account(gc);
-	info = PURPLE_CONTACT_INFO(account);
-	cid = g_new0(struct chat_invite_data, 1);
-
-	plugin_return = GPOINTER_TO_INT(purple_signal_emit_return_1(
-					purple_conversations_get_handle(),
-					"chat-invited", account, who, name, message, data));
-
-	cid->gc = gc;
-	cid->components = data;
-
-	if (plugin_return == 0)
-	{
-		char *buf2;
-
-		if(message != NULL) {
-			buf2 = g_strdup_printf(_("%s has invited %s to the chat room "
-			                         "%s:\n%s"),
-			                       who,
-			                       purple_contact_info_get_username(info),
-			                       name, message);
-		} else {
-			buf2 = g_strdup_printf(_("%s has invited %s to the chat room %s\n"),
-			                       who,
-			                       purple_contact_info_get_username(info),
-			                       name);
-		}
-
-		purple_request_accept_cancel(gc, NULL,
-			_("Accept chat invitation?"), buf2,
-			PURPLE_DEFAULT_ACTION_NONE,
-			purple_request_cpar_from_connection(gc), cid,
-			G_CALLBACK(chat_invite_accept),
-			G_CALLBACK(chat_invite_reject));
-		g_free(buf2);
-	}
-	else if (plugin_return > 0)
-		chat_invite_accept(cid);
-	else
-		chat_invite_reject(cid);
-}
-
-PurpleConversation *purple_serv_got_joined_chat(PurpleConnection *gc,
-											   int id, const char *name)
-{
-	PurpleConversation *chat;
-	PurpleAccount *account;
-
-	account = purple_connection_get_account(gc);
-
-	g_return_val_if_fail(account != NULL, NULL);
-	g_return_val_if_fail(name != NULL, NULL);
-
-	chat = purple_chat_conversation_new(account, name);
-	g_return_val_if_fail(chat != NULL, NULL);
-
-	if (!g_slist_find(purple_connection_get_active_chats(gc), chat))
-		_purple_connection_add_active_chat(gc, PURPLE_CHAT_CONVERSATION(chat));
-
-	purple_chat_conversation_set_id(PURPLE_CHAT_CONVERSATION(chat), id);
-
-	purple_signal_emit(purple_conversations_get_handle(), "chat-joined", chat);
-
-	return chat;
-}
-
 void purple_serv_got_chat_left(PurpleConnection *g, int id)
 {
 	GSList *bcs;
@@ -588,112 +310,3 @@
 
 	purple_signal_emit(purple_conversations_get_handle(), "chat-left", chat);
 }
-
-void purple_serv_got_join_chat_failed(PurpleConnection *gc, GHashTable *data)
-{
-	purple_signal_emit(purple_conversations_get_handle(), "chat-join-failed",
-					gc, data);
-}
-
-void purple_serv_got_chat_in(PurpleConnection *g, int id, const char *who,
-					  PurpleMessageFlags flags, const char *message, time_t mtime)
-{
-	GSList *bcs;
-	PurpleChatConversation *chat = NULL;
-	char *buffy, *angel;
-	int plugin_return;
-	PurpleMessage *pmsg;
-
-	g_return_if_fail(who != NULL);
-	g_return_if_fail(message != NULL);
-
-	if (mtime < 0) {
-		purple_debug_error("server",
-				"purple_serv_got_chat_in ignoring negative timestamp\n");
-		/* TODO: Would be more appropriate to use a value that indicates
-		   that the timestamp is unknown, and surface that in the UI. */
-		mtime = time(NULL);
-	}
-
-	for (bcs = purple_connection_get_active_chats(g); bcs != NULL; bcs = bcs->next) {
-		if (purple_chat_conversation_get_id(
-				PURPLE_CHAT_CONVERSATION(bcs->data)) == id) {
-			chat = (PurpleChatConversation *)bcs->data;
-			break;
-		}
-	}
-
-	if (!chat)
-		return;
-
-	/* Did I send the message? */
-	if (purple_strequal(purple_chat_conversation_get_nick(chat),
-			purple_normalize(purple_conversation_get_account(
-			PURPLE_CONVERSATION(chat)), who))) {
-		flags |= PURPLE_MESSAGE_SEND;
-		flags &= ~PURPLE_MESSAGE_RECV; /* Just in case some protocol sets it! */
-	} else {
-		flags |= PURPLE_MESSAGE_RECV;
-	}
-
-	/*
-	 * Make copies of the message and the sender in case plugins want
-	 * to free these strings and replace them with a modified version.
-	 */
-	buffy = g_strdup(message);
-	angel = g_strdup(who);
-
-	plugin_return = GPOINTER_TO_INT(
-		purple_signal_emit_return_1(purple_conversations_get_handle(),
-								  "receiving-chat-msg", purple_connection_get_account(g),
-								  &angel, &buffy, chat, &flags));
-
-	if (!buffy || !angel || plugin_return) {
-		g_free(buffy);
-		g_free(angel);
-		return;
-	}
-
-	who = angel;
-	message = buffy;
-
-	purple_signal_emit(purple_conversations_get_handle(), "received-chat-msg", purple_connection_get_account(g),
-					 who, message, chat, flags);
-
-	if (flags & PURPLE_MESSAGE_RECV) {
-		pmsg = purple_message_new_incoming(who, message, flags, mtime);
-	} else {
-		PurpleAccount *account = purple_connection_get_account(g);
-		PurpleContactInfo *info = PURPLE_CONTACT_INFO(account);
-		GDateTime *dt = g_date_time_new_from_unix_local((gint64)mtime);
-		const gchar *me = purple_contact_info_get_name_for_display(info);
-
-		pmsg = purple_message_new_outgoing(me, who, message, flags);
-		purple_message_set_timestamp(pmsg, dt);
-		g_date_time_unref(dt);
-	}
-	purple_conversation_write_message(PURPLE_CONVERSATION(chat), pmsg);
-
-	g_free(angel);
-	g_free(buffy);
-
-	g_object_unref(pmsg);
-}
-
-void purple_serv_send_file(PurpleConnection *gc, const char *who, const char *file)
-{
-	PurpleProtocol *protocol;
-
-	if (gc) {
-		protocol = purple_connection_get_protocol(gc);
-
-		if(PURPLE_IS_PROTOCOL_XFER(protocol)) {
-			PurpleProtocolXfer *xfer = PURPLE_PROTOCOL_XFER(protocol);
-
-			if(purple_protocol_xfer_can_receive(xfer, gc, who)) {
-				purple_protocol_xfer_send_file(xfer,
-						gc, who, file);
-			}
-		}
-	}
-}
