static void buddy_signed_on(PurpleBuddy* buddy, void* data)
{
- Q_UNUSED(data);
qDebug() << purple_buddy_get_contact_alias(buddy) << "signed on";
+
+ PurpleAccount* acct = purple_buddy_get_account(buddy);
+ QVariantMap m;
+ m["proto"] = QString::fromUtf8(purple_account_get_protocol_id(acct));
+ m["account"] = QString::fromUtf8(purple_account_get_username(acct));
+ m["buddy"] = QString::fromUtf8(purple_buddy_get_name(buddy));
+
+ RibbonBlist* blist = (RibbonBlist*)data;
+ blist->event(QString::fromUtf8("blist"),
+ QString::fromUtf8("buddy_signed_on"),
+ m);
}
void RibbonBlist::init()
static int handle;
void *blist_handle = purple_blist_get_handle();
purple_signal_connect(blist_handle, "buddy-signed-on", &handle,
- PURPLE_CALLBACK(buddy_signed_on), NULL);
+ PURPLE_CALLBACK(buddy_signed_on), this);
}