]> git.pld-linux.org Git - packages/gg2.git/blob - gg2-dbus.patch
- from Tomasz Grobelny (tomasz at grobelny oswiecenia net)
[packages/gg2.git] / gg2-dbus.patch
1 diff -u -r gg2-2.2.8.orig/src/plugins/dbus/dbus_plugin.c gg2-2.2.8/src/plugins/dbus/dbus_plugin.c
2 --- gg2-2.2.8.orig/src/plugins/dbus/dbus_plugin.c       2005-01-10 10:39:11.000000000 +0100
3 +++ gg2-2.2.8/src/plugins/dbus/dbus_plugin.c    2005-09-18 00:11:48.000000000 +0200
4 @@ -79,6 +79,7 @@
5                         {
6                                 DBusMessage *return_message;
7                                 GGaduContact *k = NULL;
8 +                               const gchar *arg_empty = "";
9                                 
10                                 return_message = dbus_message_new_method_return(message);
11  
12 @@ -106,14 +107,23 @@
13                                         
14                                         /* not sure about this g_strdup() */
15                                         status_descr = k->status_descr ? g_strdup(k->status_descr) : "";
16 -                                       
17 -                                       dbus_message_append_args(return_message, DBUS_TYPE_STRING, return_status, DBUS_TYPE_STRING, status_descr,DBUS_TYPE_STRING, "", DBUS_TYPE_INVALID);
18 +
19 +                                        dbus_message_append_args(return_message,
20 +                                                       DBUS_TYPE_STRING, &return_status,
21 +                                                       DBUS_TYPE_STRING, &status_descr,
22 +                                                       DBUS_TYPE_STRING, &arg_empty,
23 +                                                       DBUS_TYPE_INVALID);
24                                         GGaduContact_free(k);
25                                 }
26                                 else
27                                 {
28 +                                       const gchar *arg_unknown = "Unknown";
29                                         print_debug("NOT FOUND: Unknown");
30 -                                       dbus_message_append_args(return_message, DBUS_TYPE_STRING, "Unknown", DBUS_TYPE_STRING, "",DBUS_TYPE_STRING, "", DBUS_TYPE_INVALID);
31 +                                       dbus_message_append_args(return_message,
32 +                                                       DBUS_TYPE_STRING, &arg_unknown,
33 +                                                       DBUS_TYPE_STRING, &arg_empty,
34 +                                                       DBUS_TYPE_STRING, &arg_empty,
35 +                                                       DBUS_TYPE_INVALID);
36                                 }
37                                 /* I can free here because signal return copy of GGaduContact */
38                                 dbus_connection_send(connection, return_message, NULL);
39 @@ -121,7 +131,6 @@
40                         }
41                         plugins = plugins->next;
42                 }
43 -               dbus_free(contactURI);
44                 g_strfreev(URItab);
45                 g_free(contactURIhandler);
46         }
47 @@ -154,7 +163,7 @@
48                         if (p)
49                         {
50                                 print_debug("proto: %s", p->protocol_uri);
51 -                               dbus_message_append_args(return_message, DBUS_TYPE_STRING, p->protocol_uri, DBUS_TYPE_INVALID);
52 +                               dbus_message_append_args(return_message, DBUS_TYPE_STRING, &p->protocol_uri, DBUS_TYPE_INVALID);
53                         }
54  
55                         index = ggadu_repo_value_next("_protocols_", REPO_VALUE_PROTOCOL, &key, index);
56 @@ -224,10 +233,9 @@
57                 }
58                 g_strfreev(URItab);
59                 g_free(contactURIhandler);
60 -               dbus_free(contactURI);
61         }
62         
63 -       dbus_message_append_args(return_message, DBUS_TYPE_BOOLEAN, ret, DBUS_TYPE_INVALID);
64 +       dbus_message_append_args(return_message, DBUS_TYPE_BOOLEAN, &ret, DBUS_TYPE_INVALID);
65         dbus_connection_send(connection, return_message, NULL);
66         dbus_message_unref(return_message);
67         dbus_error_free(&error);
68 @@ -247,7 +255,7 @@
69                     dbus_message_get_path(message), dbus_message_get_interface(message), dbus_message_get_type(message));
70  
71  
72 -       if (dbus_message_is_signal(message, DBUS_INTERFACE_ORG_FREEDESKTOP_LOCAL, "Disconnected"))
73 +       if (dbus_message_is_signal(message, DBUS_INTERFACE_LOCAL, "Disconnected"))
74         {
75                 print_debug("dbus signal: Disconnected");
76                 return DBUS_HANDLER_RESULT_HANDLED;
77 @@ -305,7 +313,7 @@
78         dbus_connection_setup_with_g_main(bus, g_main_loop_get_context(config->main_loop));
79  
80         dbus_error_init(&derror);
81 -       dbus_bus_acquire_service(bus, DBUS_ORG_FREEDESKTOP_IM_SERVICE, 0, &derror);
82 +       dbus_bus_request_name(bus, DBUS_ORG_FREEDESKTOP_IM_SERVICE, 0, &derror);
83         if (dbus_error_is_set(&derror))
84         {
85                 g_warning("DBUS: Failed to acquire IM service. %s", derror.message);
86
This page took 0.100843 seconds and 3 git commands to generate.