# HG changeset patch # User tdrhq@soc.pidgin.im # Date 1250658241 0 # Node ID 5c53eabcea93268f65b13230ab035b3d21af3ac3 # Parent 1cebf9aa291a6eef43519095fcc7a3a170187b71 Adds the 'groupchat' classname to #Chat when using groupchat. This should be the only requirement for Adium 1.3.x. diff -r 1cebf9aa291a -r 5c53eabcea93 pidgin/plugins/adiumthemes/webkit.c --- a/pidgin/plugins/adiumthemes/webkit.c Wed Aug 19 02:43:17 2009 +0000 +++ b/pidgin/plugins/adiumthemes/webkit.c Wed Aug 19 05:04:01 2009 +0000 @@ -309,6 +309,20 @@ webkit_web_view_set_transparent (webview, style->default_background_is_transparent); } +/* + * The style specification says that if the conversation is a group + * chat then the
element will be given a class + * 'groupchat'. I can't add another '%@' in Template.html because + * that breaks style-specific Template.html's. I have to either use libxml + * or conveniently play with WebKit's javascript engine. The javascript + * engine should work, but it's not an identical behavior. + */ +static void +webkit_set_groupchat (GtkWebView *webview) +{ + gtk_webview_safe_execute_script (webview, "document.getElementById('Chat').className = 'groupchat'"); +} + /** * Called when either a new PurpleConversation is created @@ -361,6 +375,8 @@ /* I need to unref this style when the webkit object destroys */ g_signal_connect (G_OBJECT(webkit), "destroy", G_CALLBACK(webkit_on_webview_destroy), copy); + if (purple_conversation_get_type (conv) == PURPLE_CONV_TYPE_CHAT) + webkit_set_groupchat (GTK_WEBVIEW (webkit)); g_free (basedir); g_free (baseuri); g_free (header);