use recommended function
add libpurple 3.0 compatibility - untested