diff src/conversation.c @ 10665:4829abdc5c35

[gaim-migrate @ 12205] and to oldstatus committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Mon, 07 Mar 2005 18:36:34 +0000
parents 55e7d72fc09a
children 51ea57c36056
line wrap: on
line diff
--- a/src/conversation.c	Mon Mar 07 18:19:00 2005 +0000
+++ b/src/conversation.c	Mon Mar 07 18:36:34 2005 +0000
@@ -138,7 +138,7 @@
 	type = gaim_conversation_get_type(conv);
 	ops  = gaim_conversation_get_ui_ops(conv);
 
-	if (gc->flags & GAIM_CONNECTION_HTML)
+	if (conv->features & GAIM_CONNECTION_HTML)
 		displayed = gaim_markup_linkify(message);
 	else
 		displayed = g_strdup(message);
@@ -188,7 +188,7 @@
 		if (sent != NULL && sent[0] != '\0') {
 			GaimMessageFlags msgflags = GAIM_MESSAGE_SEND;
 
-			if (gc && gc->flags & GAIM_CONNECTION_HTML) {
+			if (conv->features & GAIM_CONNECTION_HTML) {
 				err = serv_send_im(gc, gaim_conversation_get_name(conv),
 				                   sent, 0);
 			} else {
@@ -212,7 +212,7 @@
 						 gaim_conv_chat_get_id(GAIM_CONV_CHAT(conv)));
 
 		if (sent != NULL && sent[0] != '\0') {
-			if (gc && gc->flags & GAIM_CONNECTION_HTML) {
+			if (conv->features & GAIM_CONNECTION_HTML) {
 				err = serv_chat_send(gc, gaim_conv_chat_get_id(GAIM_CONV_CHAT(conv)), sent);
 			} else {
 				gchar *tmp = gaim_unescape_html(sent);
@@ -748,6 +748,7 @@
 					  const char *name)
 {
 	GaimConversation *conv;
+	GaimConnection *gc;
 
 	g_return_val_if_fail(type    != GAIM_CONV_UNKNOWN, NULL);
 	g_return_val_if_fail(account != NULL, NULL);
@@ -766,6 +767,9 @@
 		}
 	}
 
+	gc = gaim_account_get_connection(account);
+	g_return_val_if_fail(gc != NULL, NULL);
+
 	conv = g_new0(GaimConversation, 1);
 
 	conv->type         = type;
@@ -779,7 +783,9 @@
 	conv->log          = gaim_log_new(type == GAIM_CONV_CHAT ? GAIM_LOG_CHAT :
 									  GAIM_LOG_IM, conv->name, account,
 									  time(NULL));
-
+	/* copy features from the connection. */
+	conv->features = gc->flags;
+	
 
 	if (type == GAIM_CONV_IM)
 	{
@@ -1025,6 +1031,30 @@
 	conv = NULL;
 }
 
+
+void
+gaim_conversation_set_features(GaimConversation *conv, GaimConnectionFlags features)
+{
+	GaimConversationUiOps *ops;
+
+	g_return_if_fail(conv != NULL);
+
+	conv->features = features;
+
+	ops = conv->ui_ops;
+	if(ops && ops->updated)
+		ops->updated(conv, GAIM_CONV_UPDATE_FEATURES);	
+}
+
+
+GaimConnectionFlags
+gaim_conversation_get_features(GaimConversation *conv)
+{
+	g_return_val_if_fail(conv != NULL, 0);
+	return conv->features;
+}
+
+
 GaimConversationType
 gaim_conversation_get_type(const GaimConversation *conv)
 {