diff src/prpl.c @ 10006:9baedaca25c7

[gaim-migrate @ 10923] This is a patch from Dave West. He says it makes people show up as online/offline for him. It crashes for me. I've changed some things from his patch, so I'm gonna commit it and let people work from there. I feel it's a step in the right direction. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Fri, 10 Sep 2004 04:09:36 +0000
parents ced29c7b396c
children 267a2b69e36e
line wrap: on
line diff
--- a/src/prpl.c	Fri Sep 10 02:51:22 2004 +0000
+++ b/src/prpl.c	Fri Sep 10 04:09:36 2004 +0000
@@ -256,12 +256,7 @@
 
 	presence = gaim_buddy_get_presence(buddy);
 
-	/*
-	 * TODO: Set a presence's sign-on time. We don't support this yet.
-	 */
-	gaim_debug_warning("prpl",
-					   "Attempting to set a user's sign-on time, but we "
-					   "don't support this yet! FIX IT!\n");
+	gaim_presence_set_login_time(presence, login_time);
 }
 
 void
@@ -339,6 +334,36 @@
 		prpl_info->set_status(account, status);
 }
 
+GList *
+gaim_prpl_get_statuses(GaimAccount *account, GaimPresence *presence)
+{
+	GaimPlugin *prpl;
+	GaimPluginProtocolInfo *prpl_info;
+	GList *statuses = NULL;
+	GList *l;
+	GaimStatus *status;
+
+	g_return_val_if_fail(account != NULL, NULL);
+	g_return_val_if_fail(presence != NULL, NULL);
+
+	prpl = gaim_find_prpl(gaim_account_get_protocol_id(account));
+	
+	if (prpl == NULL)
+		return NULL;
+	
+	prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(prpl);
+	if (prpl_info == NULL || prpl_info->status_types == NULL)
+		return NULL;
+
+	for (l = prpl_info->status_types(account); l != NULL; l = l->next)
+	{
+		status = gaim_status_new((GaimStatusType *)l->data, presence);
+		statuses = g_list_append(statuses, status);
+	}
+
+	return statuses;
+}
+
 
 /**************************************************************************
  * Protocol Plugin Subsystem API