View Single Post
b666m's Avatar
Posts: 1,090 | Thanked: 476 times | Joined on Jan 2010 @ Ingolstadt, Germany
#51
ok... now i need help.

the dbus signal from pidgin looks like:
Code:
void (*received_im_msg)(PurpleAccount *account, char *sender, char *message, PurpleConversation *conv, PurpleMessageFlags flags);
my dbus-monitor says:
Code:
signal sender=:1.12 -> dest=(null destination) serial=4223 path=/im/pidgin/purple/PurpleObject; interface=im.pidgin.purple.PurpleInterface; member=ReceivedImMsg
   int32 1100
   string "240597622"
   string "outsch"
   int32 43000
   uint32 2
so the structs "PurpleAccount" and "PurpleConversation" are broken down to an INT32 on dbus(?!?!?!?)

so my marshaller has to look like:
Code:
/* Register dbus signal marshaller */
    dbus_g_object_register_marshaller(marshal_VOID__INT_STRING_STRING_INT_UINT, 
                                      G_TYPE_NONE, G_TYPE_INT, G_TYPE_STRING, 
                                      G_TYPE_STRING, G_TYPE_INT, G_TYPE_UINT, 
                                      G_TYPE_INVALID);
which after adding and connecting to the signal leads to my callback:
Code:
void received_im_msg_cb (DBusGProxy *purple_proxy, int account_id, 
                         const char *sender, const char *message, 
                         int conv_id, unsigned int flags,
                         gpointer user_data)
where we see that my account_id and conv_id is INT.

that's why i can't use these three very cool functions:
Code:
const char *purple_account_get_alias(const PurpleAccount *account);
const char *purple_account_get_buddy_icon_path(const PurpleAccount *account);
const char *purple_account_get_protocol_name(const PurpleAccount *account);
just because they want a STRUCT and not an INT as parameter.

has anyone any idea how to solve this problem? :/

why does pidgin say that it sends a struct and my monitor recognizes an integer?

and are there maybe any cool G_TYPE_xxx for getting structs from dbus?