Automattic/Co-Authors-Plus — pull request #60 by vickybiswas (2012-09-11 20:17:44+00:00)
Title: A Fix to modify the user query to return more accurate data Should also Solve #33

I came across this problem where I created 3 posts
1. Post with a native WP user
2. Post with same native user but I removed the native user and added a Guest Author Instead
3. Post with same native user as the two above and added a Guest Author.
The Issue...
When I saw the author page for the Guest Author I saw 2 and 3
When I saw the author page for The Wp native user I saw 1 2 and 3
While the former was as it is supposed to be the latter should have shown only 1 and 3 as the WP user was "not attached" to post

This solution treats a post to be of the user if
1. The User is in Guest Author List
2. The User is in WP User Field and no Guest Author is attached to post

Two things I think I can do to enhance the plugin further
1. I believe we can do away with the force_guest_author flag after this change
2. I believe instead of the 2 INNER JOINS on Line 550 and 551 if we use LEFT Joins it will be more logical and faster in terms of query execution speed

Regards,
Vicky Biswas