A quote within a quote notification

General discussion of development ideas and the approaches taken in the 3.x branch of phpBB. The current feature release of phpBB 3 is 3.3/Proteus.
Forum rules
Please do not post support questions regarding installing, updating, or upgrading phpBB 3.3.x. If you need support for phpBB 3.3.x please visit the 3.3.x Support Forum on phpbb.com.

If you have questions regarding writing extensions please post in Extension Writers Discussion to receive proper guidance from our staff and community.
Post Reply
aleha
Registered User
Posts: 143
Joined: Tue Mar 26, 2013 2:19 am

A quote within a quote notification

Post by aleha »

With the current notification system I am getting a notification for the following quotation, that is when I am not quoted directly.
Is this behavior intended or is it a bug?
someRandomUserQuotesMe wrote:
aleha wrote: msg1
msg2

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 1858
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth
Contact:

Re: A quote within a quote notification

Post by DavidIQ »

I've noticed this as well. I would say it's bug.
Image

User avatar
JoshyPHP
Registered User
Posts: 376
Joined: Fri Jul 08, 2011 9:43 pm

Re: A quote within a quote notification

Post by JoshyPHP »

I think the way you'll have to fix it in 3.1 is you'll have to iterate over every quote tag with a regexp like (\[/?quote(?:=".*?"):\w+\]) and maintain a counter with the number of quote tags currently open. And of course, only notify the authors of the outermost quotes.

In 3.2, assuming my PR gets merged, I think the best way to go would be to add a method to phpbb\textformatter\utils_interface that retrieves the quotes' authors from a given text. Messages parsed with s9e\TextFormatter are stored as XML so it's easy to retrieve the outermost quote via XPath with //QUOTE[not(ancestor::QUOTE)]/@author. It may be a good idea to add a user_id parameter to quote tags too.

aleha
Registered User
Posts: 143
Joined: Tue Mar 26, 2013 2:19 am

Re: A quote within a quote notification

Post by aleha »


User avatar
JoshyPHP
Registered User
Posts: 376
Joined: Fri Jul 08, 2011 9:43 pm

Re: A quote within a quote notification

Post by JoshyPHP »

I'm going to write a fix for 3.2 but I'd need someone to propose a good name for the function that retrieves the names of all authors for first-level quotes. So far I'm thinking about get_quote_authors_but_not_all_of_them_really_only_the_first_level_of_quotes() but I'm open to suggestions.

User avatar
Pony99CA
Registered User
Posts: 986
Joined: Sun Feb 08, 2009 2:35 am
Location: Hollister, CA
Contact:

Re: A quote within a quote notification

Post by Pony99CA »

get_primary_quote_authors
get_top_level_quote_authors
get_first_level_quote_authors
get_outermost_quote_authors

Steve
Silicon Valley Pocket PC (http://www.svpocketpc.com)
Creator of manage_bots and spoof_user (ask me)
Need hosting for a small forum with full cPanel & MySQL access? Contact me or PM me.

User avatar
Mess
Registered User
Posts: 199
Joined: Wed Jun 13, 2012 10:14 am

Re: A quote within a quote notification

Post by Mess »

JoshyPHP wrote:I'm going to write a fix for 3.2 but I'd need someone to propose a good name for the function that retrieves the names of all authors for first-level quotes. So far I'm thinking about get_quote_authors_but_not_all_of_them_really_only_the_first_level_of_quotes() but I'm open to suggestions.
:lol:

User avatar
JoshyPHP
Registered User
Posts: 376
Joined: Fri Jul 08, 2011 9:43 pm

Re: A quote within a quote notification

Post by JoshyPHP »

Pony99CA wrote:get_primary_quote_authors
get_top_level_quote_authors
get_first_level_quote_authors
get_outermost_quote_authors

Steve
get_outermost_quote_authors might just be the best. It's descriptive while remaining short enough.

aleha
Registered User
Posts: 143
Joined: Tue Mar 26, 2013 2:19 am

Re: A quote within a quote notification

Post by aleha »

This was fixed in 3.2 today but it requires a separate solution for 3.1.x.
The ticket for 3.1.x is: https://tracker.phpbb.com/browse/PHPBB3-13855

Post Reply