Not easy to solve... well, it could be easy to workaround, there is to add a bit to the url in the menu array (and maybe other places), but it would just be a way to "trick" the system a bit more, not to really solve the problem.
The action a user is doing is determined by the last url he visited.
In the case you are describing, User A is visiting the url:
http://www.elkarte.net/community/index.php?action=profile
When User B visits User A's profile, Elk finds the URL above in the log and starts trying to understand what the user is doing.
Normally, if Elk finds the bit: "u=123", then it's able to identify that User B is watching the profile of the user with id "123", but in that case, there is no "u" param in the url, so Elk thinks "without the u-bits, the user is watching his own profile".
To fix the problem it would be necessary to check if the current user is the owner of the profile, maybe change in Who.subs.php:
// Whose? Their own?
if (empty($actions['u']))
$actions['u'] = $url[1];
to
// Whose? Their own?
if (empty($actions['u']))
{
$memID = currentMemberID();
if ($memID == $user_info['id'])
$actions['u'] = $url[1];
else
$actions['u'] = $memID;
}
could work... maybe, not tested at all.