I am using D6 and I use and implementation for the hook_nodeapi and hook_comment.
I am using a flag named follow. See the code below, maybe it can be of any help for someone.
This code returns a list of uids who have flagged the node which has changed (or has a new comment attached to it).
/** * Implementation of hook_nodeapi(). */ function MYMODULE_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) { switch ($op) { case 'update': // check if this node is flagged $flag_name = 'follow'; $flag = flag_get_flag($flag_name); if($flag && $flag->is_flagged($node->nid)) { $list_uid = flag_get_content_flags(node, $node->nid, $flag_name, FALSE); $flags_by_uids = array(); foreach($list_uid as $flags_by_uid) { $flags_by_uids[] = array($flags_by_uid->uid); } } break; } } /** * Implementation of hook_comment(). */ function MYMODULE_comment(&$a1, $op) { switch ($op) { case 'publish': // check if this node is flagged $flag_name = 'follow'; $flag = flag_get_flag($flag_name); if($flag && $flag->is_flagged($a1[nid])) { $list_uid = flag_get_content_flags(node, $a1[nid], $flag_name, FALSE); $flags_by_uids = array(); foreach($list_uid as $flags_by_uid) { $flags_by_uids[] = array($flags_by_uid->uid); } } break; } }