Sorry if i am missing something or wrong..

function buddy_api_get_buddies() doesn't check the user status. Whether the user is active or blocked. We need to return only active buddies but not the blocked ones.

The sql

 $sql = 'SELECT u.uid, u.name, b.buddy FROM {buddylist} b
            INNER JOIN {users} u ON b.buddy = u.uid
            WHERE b.uid = %d';

I think its good to add u.status = 1 to where clause.

$sql = 'SELECT u.uid, u.name, b.buddy FROM {buddylist} b
            INNER JOIN {users} u ON b.buddy = u.uid
            WHERE b.uid = %d AND u.status = 1';

By adding the status we only return only active buddies but not the blocked ones.

Looking forward to hear from others and author.

Comments

nodestroy’s picture

hi,

yes, you are right. will fix this today.

sangamreddi’s picture

Thanks..

nodestroy’s picture

Status: Active » Fixed

done

Anonymous’s picture

Status: Fixed » Closed (fixed)
nodestroy’s picture

Project: » Buddylist2