gobjectification.conversation: 12901a85: Renamespace a couple of functions.

sadrul at pidgin.im sadrul at pidgin.im
Sat Jul 24 23:10:42 EDT 2010


----------------------------------------------------------------------
Revision: 12901a85801f8916a18a8e9d8d555da7a7ff5efe
Parent:   e1befba98bfdb73b3a79ab345fa5472b2e368a3a
Author:   sadrul at pidgin.im
Date:     07/24/10 19:25:46
Branch:   im.pidgin.gobjectification.conversation
URL: http://d.pidgin.im/viewmtn/revision/info/12901a85801f8916a18a8e9d8d555da7a7ff5efe

Changelog: 

Renamespace a couple of functions.

Changes against parent e1befba98bfdb73b3a79ab345fa5472b2e368a3a

  patched  libpurple/conversation/convs.c
  patched  libpurple/conversation/convs.h
  patched  libpurple/conversation.c

-------------- next part --------------
============================================================
--- libpurple/conversation.c	259bc116ed897a7b05200055670e822ab66e930b
+++ libpurple/conversation.c	6a1826fb6833a914e1a3e208e66d1ee88a1bdccb
@@ -1373,23 +1373,6 @@ purple_conv_im_write(PurpleConvIm *im, c
 		purple_conversation_write(c, who, message, flags, mtime);
 }
 
-gboolean purple_conv_present_error(const char *who, PurpleAccount *account, const char *what)
-{
-	PurpleConversation *conv;
-
-	g_return_val_if_fail(who != NULL, FALSE);
-	g_return_val_if_fail(account !=NULL, FALSE);
-	g_return_val_if_fail(what != NULL, FALSE);
-
-	conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_ANY, who, account);
-	if (conv != NULL)
-		purple_conversation_write(conv, NULL, what, PURPLE_MESSAGE_ERROR, time(NULL));
-	else
-		return FALSE;
-
-	return TRUE;
-}
-
 void
 purple_conv_im_send(PurpleConvIm *im, const char *message)
 {
@@ -2176,23 +2159,6 @@ const char *purple_conv_chat_get_nick(Pu
 	return chat->nick;
 }
 
-PurpleConversation *
-purple_find_chat(const PurpleConnection *gc, int id)
-{
-	GList *l;
-	PurpleConversation *conv;
-
-	for (l = purple_get_chats(); l != NULL; l = l->next) {
-		conv = (PurpleConversation *)l->data;
-
-		if (purple_conv_chat_get_id(PURPLE_CONV_CHAT(conv)) == id &&
-			purple_conversation_get_gc(conv) == gc)
-			return conv;
-	}
-
-	return NULL;
-}
-
 void
 purple_conv_chat_left(PurpleConvChat *chat)
 {
============================================================
--- libpurple/conversation/convs.c	43bf9d42827c7f4f096256bcf74b32df0c8b12db
+++ libpurple/conversation/convs.c	64919d0874366532a01ace33ee80d1d1fd7a302f
@@ -104,6 +104,34 @@ purple_conversations_find(GType type, Pu
 	return ret;
 }
 
+PurpleConversation *
+purple_conversations_find_muc(PurpleConnection *con, int id)
+{
+	PurpleAccount *account = purple_connection_get_account(con);
+	GList *iter;
+	for (iter = global.mucs; iter; iter = iter->next) {
+		PurpleConversation *muc = iter->data;
+		if (purple_conversation_get_account(muc) == account &&
+				purple_muc_get_id(PURPLE_MUC(muc)) == id)
+			return muc;
+	}
+	return NULL;
+}
+
+gboolean
+purple_conversations_present_error(const char *who, PurpleAccount *account,
+		const char *what)
+{
+	PurpleConversation *conv = purple_conversations_find(PURPLE_TYPE_CONVERSATION,
+			account, who);
+	if (!conv)
+		return FALSE;
+
+	purple_conversation_write_message(conv, what, PURPLE_MESSAGE_ERROR);
+
+	return TRUE;
+}
+
 static PurpleConvHash *
 conv_hash_create(PurpleConversation *conv, PurpleConvHash *hash)
 {
============================================================
--- libpurple/conversation/convs.h	e86b697f58519adbf0c94ed8cbc2324eaccf0993
+++ libpurple/conversation/convs.h	54df326a188ce9c528adda0900c2eadfe0956a48
@@ -34,6 +34,11 @@ PurpleConversation * purple_conversation
 PurpleConversation * purple_conversations_find(GType type, PurpleAccount *account,
 		const char *name);
 
+PurpleConversation * purple_conversations_find_muc(PurpleConnection *con, int id);
+
+gboolean purple_conversations_present_error(const char *who, PurpleAccount *account,
+		const char *what);
+
 void purple_conversations_init(void);
 
 void purple_conversations_uninit(void);


More information about the Commits mailing list