How can I obtain the "latest" vid when on Revisioning's "View latest" tab? I am using the Revisioning module to handle content revisions and I am creating a custom block that needs the vid of the node that the user is viewing to generate the appropriate content. I was trying to use menu_get_object() to obtain this and it works fine for a node with no revisions. 

When I have a pending revision in Draft that I am looking at via the "View latest" tab, the node->vid I obtain from menu_get_object() is the vid of the "current" version, not the "latest". What would be the best way for me to obtain the vid of the version that is actually being displayed to the user?
I dug into the Revisioning module to see how they are doing the check and adapted it for use in a helper function in my module. I first load the node using menu_get_object() and then call the following:

function _get_correct_revision($node) {
  if (module_exists('revisioning')) {
    if (_revisioning_load_op($node, 'view') == REVISIONING_LOAD_LATEST) {
      $vid_to_load = revisioning_get_latest_revision_id($node-&gt;nid);
      $node = node_load($node-&gt;nid, $vid_to_load);
    }
  }
  return $node-&gt;vid;
}