[aur-dev] [PATCH v2] Implement capability to pin comments above others

Lukas Fleischer lfleischer at archlinux.org
Mon Dec 7 08:32:41 UTC 2015

On Sun, 06 Dec 2015 at 04:51:05, Mark Weiman wrote:
> [...]
> Just for clarification, I just modify the aur-schema.sql file to
> include the new columns and for the upgrading file, do I put the query
> for the change in the 4.2.0.txt or in it's own file?

Yes, add the new columns to schema/aur-schema.sql and add a new section
to upgrading/4.2.0.txt with SQL queries to upgrade an existing database.

> [...]
> I'm pretty sure I did the check (if (can_pin_comment($comment_id))). It
> 's pretty much based on the pkgbase_delete_comment() function, so if I
> did indeed miss that here, that function should be checked as well.

Yeah, looks good to me. One minor additional nit, though. When checking
this kind of preconditions, we usually write

    if (!can_pin_comment($comment_id)) {
        return array(false, __("You are not allowed to pin this comment."));

and then put the main code below, without any indentation. This makes
the code a bit easier to read/follow.

> [...]
> > "Unin comment" and "Pin comment" instead of "Unpin comment"
> > 
> WHOOPS! I noticed that and I thought I changed it, but I guess it
> slipped through.
> [...]

One more thing: It would be nice if there was a pin/unpin icon similar
to the images we use for editing or deleting a comment.


More information about the aur-dev mailing list