soc.2009.telepathy: 196bf9ee: Include timestamp in messages

sttwister at soc.pidgin.im sttwister at soc.pidgin.im
Tue Jun 2 12:50:34 EDT 2009


-----------------------------------------------------------------
Revision: 196bf9ee8987e101ba9aea8e2e79622d2c1ae6b8
Ancestor: 2217070e6bd78bc6406e6ecbea3df39906c16b4d
Author: sttwister at soc.pidgin.im
Date: 2009-06-02T13:44:33
Branch: im.pidgin.soc.2009.telepathy
URL: http://d.pidgin.im/viewmtn/revision/info/196bf9ee8987e101ba9aea8e2e79622d2c1ae6b8

Modified files:
        libpurple/protocols/telepathy/telepathy.c

ChangeLog: 

Include timestamp in messages

-------------- next part --------------
============================================================
--- libpurple/protocols/telepathy/telepathy.c	bdaee3221045ee178b62f845cdbee33d56154afb
+++ libpurple/protocols/telepathy/telepathy.c	991cc87013a1021079863f587e1ba0a0d0837bae
@@ -251,30 +251,6 @@ static void
 }
 
 static void
-conversation_write (PurplePlugin *plugin,
-                    const gchar *from,
-		    const gchar *msg)
-{
-	telepathy_data *data = plugin->extra;
-	PurpleAccount *acct = data->acct;
-
-	PurpleConversation *conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, from, acct);
-
-	PurpleConvIm *im;
-
-	if (conv == NULL)
-	{
-		conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, acct, from);
-	}
-
-	purple_debug_info("telepathy", "Received from %s: \"%s\"\n", from, msg);
-
-	im = purple_conversation_get_im_data(conv);
-
-	purple_conv_im_write(im, from, msg, 0, 0);
-}
-
-static void
 received_cb (TpChannel *proxy,
              guint arg_ID,
              guint arg_Timestamp,
@@ -290,13 +266,27 @@ received_cb (TpChannel *proxy,
 
 	TpContact *contact = g_hash_table_lookup(data->contacts, (gpointer)arg_Sender);
 
-	purple_debug_info("telepathy", "Contact #%u says \"%s\"\n", arg_Sender, arg_Text);	
-
 	if (contact != NULL)
 	{
-		purple_debug_info("telepathy", "Contact %s says \"%s\"\n", tp_contact_get_identifier(contact), arg_Text);	
+		PurpleAccount *acct = data->acct;
+		gchar *from = (gchar *)tp_contact_get_identifier(contact);
 
-		conversation_write(user_data, tp_contact_get_identifier(contact), arg_Text);
+		PurpleConversation *conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, from, acct);
+
+		PurpleConvIm *im;
+
+		purple_debug_info("telepathy", "Contact %s says \"%s\"\n", from, arg_Text);	
+
+		if (conv == NULL)
+		{
+			conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, acct, from);
+		}
+
+		im = purple_conversation_get_im_data(conv);
+
+		purple_conv_im_write(im, from, arg_Text, 0, arg_Timestamp);
+
+		//conversation_write(user_data, tp_contact_get_identifier(contact), arg_Text);
 	}
 	else
 	{


More information about the Commits mailing list