User A sends friend request to User B.
User B logs in.
User B visits User A's user page and sees "Approve", but not "Deny".

"Deny" is only available in user/%user/friends/pending which is dependent on Views.

"Deny" link should also be present on the user page, along with "Approve".

Comments

sirkitree’s picture

Makes sense.

shawn dearmond’s picture

Status: Active » Needs review
StatusFileSize
new610 bytes

Here's a patch that adds the deny link within hook_user_view().

sirkitree’s picture

StatusFileSize
new996 bytes

I've changed the order of the logic a bit in this but it still has the desired effect.

I'm loading the flag at the beginning now. It was originally inside of the first 'if' statement to avoid loading the flag at all if we didn't have to. But since we're loading it in the 'else' as well, might as well just load it all.

I then moved the second if up before the first because the 'empty()' and 'isset()' should be checked in both cases I think.

sirkitree’s picture

Status: Needs review » Needs work

Note: we should expand the user test case to check for this new Deny link.

sirkitree’s picture

Status: Needs work » Needs review
StatusFileSize
new2.12 KB

Same as patch in #4 but adds in the test for the Deny link.

shawn dearmond’s picture

Status: Needs review » Reviewed & tested by the community

Excellent. I like the change in the logic. And the addition to the test was definitely a plus.

For some reason, I got a fatal error when trying to apply the patch with Git. I used "patch -p0 < ..." instead and it applied fine, and there was much rejoicing.

Looks good! Thanks!

sirkitree’s picture

Status: Reviewed & tested by the community » Fixed

Awesome, committed.

http://drupalcode.org/project/flag_friend.git/commitdiff/64edf2735e98acb...

I use the command git diff --relative --no-prefix which makes it compatible with patch -p0 < .... The patches you've been giving me I must define what file to apply the patch to. What commands have you been using?

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Aamuktha’s picture

Hi Buddies,
This is what I'm exactly searching for..But i'm using Flag friend 6.x-1.0 version.so i couldn't find any match between flag_friend. module file and patch file.Could anyone help me in this?.Plz tell me ASAP.

Thanks in advance.

sirkitree’s picture

Status: Closed (fixed) » Patch (to be ported)

Marking as need ported to 6.x-1.x