# HG changeset patch
# Node ID d3068e09379e
# Parent  ccb1d93c9df1
diff --git a/libpurple/purpleconversation.c b/libpurple/purpleconversation.c
--- a/libpurple/purpleconversation.c
+++ b/libpurple/purpleconversation.c
@@ -302,7 +302,7 @@
 		PurpleMessage *msg = NULL;
 		PurpleProtocolConversation *protocol_conversation = NULL;
 
-		msg = purple_message_new_outgoing(me, NULL, sent, msgflags);
+		msg = purple_message_new_outgoing(me, sent, msgflags);
 
 		protocol_conversation = PURPLE_PROTOCOL_CONVERSATION(protocol);
 		purple_protocol_conversation_send_message_async(protocol_conversation,
diff --git a/libpurple/purplemessage.h b/libpurple/purplemessage.h
--- a/libpurple/purplemessage.h
+++ b/libpurple/purplemessage.h
@@ -92,7 +92,6 @@
 /**
  * purple_message_new_outgoing:
  * @author: The author.
- * @recipient: The recipient.
  * @contents: The contents.
  * @flags: The #PurpleMessageFlags.
  *
@@ -106,7 +105,7 @@
  * Since: 3.0
  */
 PURPLE_AVAILABLE_IN_3_0
-PurpleMessage *purple_message_new_outgoing(const char *author, const char *recipient, const char *contents, PurpleMessageFlags flags);
+PurpleMessage *purple_message_new_outgoing(const char *author, const char *contents, PurpleMessageFlags flags);
 
 /**
  * purple_message_new_incoming:
@@ -213,31 +212,6 @@
 const char *purple_message_get_author_name_color(PurpleMessage *message);
 
 /**
- * purple_message_set_recipient:
- * @message: The #PurpleMessage instance.
- * @recipient: The name of the recipient.
- *
- * Sets the recipient of @message to @recipient.
- *
- * Since: 3.0
- */
-PURPLE_AVAILABLE_IN_3_0
-void purple_message_set_recipient(PurpleMessage *message, const char *recipient);
-
-/**
- * purple_message_get_recipient:
- * @message: The message.
- *
- * Returns the recipient of the message, not a local alias.
- *
- * Returns: the recipient of @message.
- *
- * Since: 3.0
- */
-PURPLE_AVAILABLE_IN_3_0
-const char *purple_message_get_recipient(PurpleMessage *message);
-
-/**
  * purple_message_set_author_alias:
  * @message: The message.
  * @alias: The alias.
diff --git a/libpurple/purplemessage.c b/libpurple/purplemessage.c
--- a/libpurple/purplemessage.c
+++ b/libpurple/purplemessage.c
@@ -34,7 +34,6 @@
 	char *author;
 	char *author_name_color;
 	char *author_alias;
-	char *recipient;
 
 	char *contents;
 	gboolean action;
@@ -56,7 +55,6 @@
 	PROP_AUTHOR,
 	PROP_AUTHOR_ALIAS,
 	PROP_AUTHOR_NAME_COLOR,
-	PROP_RECIPIENT,
 	PROP_CONTENTS,
 	PROP_ACTION,
 	PROP_TIMESTAMP,
@@ -106,9 +104,6 @@
 			g_value_set_string(value,
 			                   purple_message_get_author_name_color(message));
 			break;
-		case PROP_RECIPIENT:
-			g_value_set_string(value, purple_message_get_recipient(message));
-			break;
 		case PROP_CONTENTS:
 			g_value_set_string(value, purple_message_get_contents(message));
 			break;
@@ -162,9 +157,6 @@
 			purple_message_set_author_name_color(message,
 			                                     g_value_get_string(value));
 			break;
-		case PROP_RECIPIENT:
-			purple_message_set_recipient(message, g_value_get_string(value));
-			break;
 		case PROP_CONTENTS:
 			purple_message_set_contents(message, g_value_get_string(value));
 			break;
@@ -206,7 +198,6 @@
 	g_free(message->author);
 	g_free(message->author_name_color);
 	g_free(message->author_alias);
-	g_free(message->recipient);
 	g_free(message->contents);
 
 	g_clear_error(&message->error);
@@ -287,19 +278,6 @@
 		G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
 
 	/**
-	 * PurpleMessage:recipient:
-	 *
-	 * The recipient of the message.
-	 *
-	 * Since: 3.0
-	 */
-	properties[PROP_RECIPIENT] = g_param_spec_string(
-		"recipient", "Recipient",
-		"The username of the recipient.",
-		NULL,
-		G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
-	/**
 	 * PurpleMessage:contents:
 	 *
 	 * The contents of the message.
@@ -437,8 +415,8 @@
  * Public API
  *****************************************************************************/
 PurpleMessage *
-purple_message_new_outgoing(const char *author, const char *recipient,
-                            const char *contents, PurpleMessageFlags flags)
+purple_message_new_outgoing(const char *author, const char *contents,
+                            PurpleMessageFlags flags)
 {
 	PurpleMessage *message = NULL;
 	GDateTime *dt = NULL;
@@ -453,7 +431,6 @@
 	message = g_object_new(
 		PURPLE_TYPE_MESSAGE,
 		"author", author,
-		"recipient", recipient,
 		"contents", contents,
 		"timestamp", dt,
 		"flags", flags,
@@ -564,23 +541,6 @@
 }
 
 void
-purple_message_set_recipient(PurpleMessage *message, const char *recipient) {
-	g_return_if_fail(PURPLE_IS_MESSAGE(message));
-
-	g_free(message->recipient);
-	message->recipient = g_strdup(recipient);
-
-	g_object_notify_by_pspec(G_OBJECT(message), properties[PROP_RECIPIENT]);
-}
-
-const char *
-purple_message_get_recipient(PurpleMessage *message) {
-	g_return_val_if_fail(PURPLE_IS_MESSAGE(message), NULL);
-
-	return message->recipient;
-}
-
-void
 purple_message_set_author_alias(PurpleMessage *message,
                                 const char *author_alias)
 {
diff --git a/libpurple/purplesqlitehistoryadapter.c b/libpurple/purplesqlitehistoryadapter.c
--- a/libpurple/purplesqlitehistoryadapter.c
+++ b/libpurple/purplesqlitehistoryadapter.c
@@ -131,8 +131,7 @@
 	} else {
 		query = g_string_new("SELECT "
 		                     "message_id, author, author_name_color, "
-		                     "author_alias, recipient, content, "
-		                     "client_timestamp "
+		                     "author_alias, content, client_timestamp "
 		                     "FROM message_log WHERE TRUE\n");
 	}
 
@@ -303,7 +302,6 @@
 		const gchar *author = NULL;
 		const gchar *author_name_color = NULL;
 		const gchar *author_alias = NULL;
-		const gchar *recipient = NULL;
 		const gchar *content = NULL;
 		const gchar *timestamp = NULL;
 
@@ -311,9 +309,8 @@
 		author = (const gchar *)sqlite3_column_text(prepared_statement, 1);
 		author_name_color = (const gchar *)sqlite3_column_text(prepared_statement, 2);
 		author_alias = (const gchar *)sqlite3_column_text(prepared_statement, 3);
-		recipient = (const gchar *)sqlite3_column_text(prepared_statement, 4);
-		content = (const gchar *)sqlite3_column_text(prepared_statement, 5);
-		timestamp = (const gchar *)sqlite3_column_text(prepared_statement, 6);
+		content = (const gchar *)sqlite3_column_text(prepared_statement, 4);
+		timestamp = (const gchar *)sqlite3_column_text(prepared_statement, 5);
 		g_date_time = g_date_time_new_from_iso8601(timestamp, NULL);
 
 		message = g_object_new(PURPLE_TYPE_MESSAGE,
@@ -321,7 +318,6 @@
 		                       "author", author,
 		                       "author_name_color", author_name_color,
 		                       "author_alias", author_alias,
-		                       "recipient", recipient,
 		                       "contents", content,
 		                       "timestamp", g_date_time,
 		                       NULL);
@@ -395,8 +391,8 @@
 
 	script = "INSERT INTO message_log(protocol, account, conversation_id, "
 			 "message_id, author, author_name_color, author_alias, "
-			 "recipient, content, client_timestamp) "
-	         "VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
+			 "content, client_timestamp) "
+	         "VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)";
 
 	sqlite_adapter = PURPLE_SQLITE_HISTORY_ADAPTER(adapter);
 
@@ -446,13 +442,10 @@
 	                  7, purple_message_get_author_alias(message), -1,
 	                  SQLITE_STATIC);
 	sqlite3_bind_text(prepared_statement,
-	                  8, purple_message_get_recipient(message), -1,
-	                  SQLITE_STATIC);
-	sqlite3_bind_text(prepared_statement,
-	                  9, purple_message_get_contents(message), -1,
+	                  8, purple_message_get_contents(message), -1,
 	                  SQLITE_STATIC);
 	timestamp = g_date_time_format_iso8601(purple_message_get_timestamp(message));
-	sqlite3_bind_text(prepared_statement, 10, timestamp, -1, g_free);
+	sqlite3_bind_text(prepared_statement, 9, timestamp, -1, g_free);
 
 	result = sqlite3_step(prepared_statement);
 
diff --git a/libpurple/tests/test_message.c b/libpurple/tests/test_message.c
--- a/libpurple/tests/test_message.c
+++ b/libpurple/tests/test_message.c
@@ -50,7 +50,6 @@
 	char *author = NULL;
 	char *author_alias = NULL;
 	char *author_name_color = NULL;
-	char *recipient = NULL;
 	char *contents = NULL;
 	gboolean action = FALSE;
 	gboolean delivered = FALSE;
@@ -73,7 +72,6 @@
 		"author-name-color", "purple",
 		"delivered", TRUE,
 		"edited", TRUE,
-		"recipient", "pidgy",
 		"contents", "Now that is a big door",
 		"timestamp", timestamp,
 		"flags", PURPLE_MESSAGE_SYSTEM,
@@ -91,7 +89,6 @@
 		"delivered-at", &delivered_at1,
 		"edited", &edited,
 		"edited-at", &edited_at1,
-		"recipient", &recipient,
 		"contents", &contents,
 		"timestamp", &timestamp1,
 		"flags", &flags,
@@ -107,7 +104,6 @@
 	g_assert_nonnull(delivered_at1);
 	g_assert_true(edited);
 	g_assert_nonnull(edited_at1);
-	g_assert_cmpstr(recipient, ==, "pidgy");
 	g_assert_cmpstr(contents, ==, "Now that is a big door");
 	g_assert_true(g_date_time_equal(timestamp1, timestamp));
 	g_assert_cmpint(flags, ==, PURPLE_MESSAGE_SYSTEM);
@@ -119,7 +115,6 @@
 	g_clear_pointer(&author_name_color, g_free);
 	g_clear_pointer(&delivered_at1, g_date_time_unref);
 	g_clear_pointer(&edited_at1, g_date_time_unref);
-	g_clear_pointer(&recipient, g_free);
 	g_clear_pointer(&contents, g_free);
 	g_clear_pointer(&timestamp, g_date_time_unref);
 	g_clear_pointer(&timestamp1, g_date_time_unref);
