Not receiving notifications on some posts

Feedback and site usage questions

Moderator: Moderators

User avatar
Tcg
Savant
Posts: 8487
Joined: Tue Nov 21, 2017 5:01 am
Location: Third Stone
Has thanked: 2141 times
Been thanked: 2293 times

Not receiving notifications on some posts

Post #1

Post by Tcg »

I'm not receiving notifications on some posts. This seems to be limited to replies that don't include a quotation. I'm not sure if others are seeing this or if it is related to something specific about my account settings or setup in general.

User avatar
Tcg
Savant
Posts: 8487
Joined: Tue Nov 21, 2017 5:01 am
Location: Third Stone
Has thanked: 2141 times
Been thanked: 2293 times

Re: Not receiving notifications on some posts

Post #21

Post by Tcg »

Difflugia wrote: Mon Jul 12, 2021 12:57 pm [Replying to Tcg in post #11]
Tcg wrote: Mon Jul 12, 2021 5:04 am.
Response #8

"'Post reply' button, non-empty quote tag."
Nothing.

User avatar
Difflugia
Prodigy
Posts: 3017
Joined: Wed Jun 12, 2019 10:25 am
Location: Michigan
Has thanked: 3247 times
Been thanked: 1997 times

Re: Not receiving notifications on some posts

Post #22

Post by Difflugia »

[Replying to Tcg in post #11]
Tcg wrote: Mon Jul 12, 2021 5:04 ama
Response #9

"'Post reply' button, non-empty, alphanumeric response in quote tag."
My pronouns are he, him, and his.

User avatar
Difflugia
Prodigy
Posts: 3017
Joined: Wed Jun 12, 2019 10:25 am
Location: Michigan
Has thanked: 3247 times
Been thanked: 1997 times

Re: Not receiving notifications on some posts

Post #23

Post by Difflugia »

otseng wrote: Mon Jul 12, 2021 11:14 am That's correct. The reply button was code I added and not native to the phpbb software. And I couldn't figure out how to add notification to that.
There's a regular expression search on line 234 of phpBB3/includes/bbcode.php in the current code from the website (3.3.4) that matches a quotation with user ID. I'm betting that's the one used to send the notification.
My pronouns are he, him, and his.

User avatar
Tcg
Savant
Posts: 8487
Joined: Tue Nov 21, 2017 5:01 am
Location: Third Stone
Has thanked: 2141 times
Been thanked: 2293 times

Re: Not receiving notifications on some posts

Post #24

Post by Tcg »

Difflugia wrote: Mon Jul 12, 2021 1:02 pm [Replying to Tcg in post #11]
Tcg wrote: Mon Jul 12, 2021 5:04 ama
Response #9

"'Post reply' button, non-empty, alphanumeric response in quote tag."
Nothing.

User avatar
Difflugia
Prodigy
Posts: 3017
Joined: Wed Jun 12, 2019 10:25 am
Location: Michigan
Has thanked: 3247 times
Been thanked: 1997 times

Re: Not receiving notifications on some posts

Post #25

Post by Difflugia »

Tcg wrote: Mon Jul 12, 2021 1:17 pm Nothing.
That's weird. I expected that one to work and was already assuming that it had.
My pronouns are he, him, and his.

User avatar
Tcg
Savant
Posts: 8487
Joined: Tue Nov 21, 2017 5:01 am
Location: Third Stone
Has thanked: 2141 times
Been thanked: 2293 times

Re: Not receiving notifications on some posts

Post #26

Post by Tcg »

Difflugia wrote: Mon Jul 12, 2021 1:27 pm
Tcg wrote: Mon Jul 12, 2021 1:17 pm Nothing.
That's weird. I expected that one to work and was already assuming that it had.
I double checked it. No notification. You can try again in case I missed something.

User avatar
Difflugia
Prodigy
Posts: 3017
Joined: Wed Jun 12, 2019 10:25 am
Location: Michigan
Has thanked: 3247 times
Been thanked: 1997 times

Re: Not receiving notifications on some posts

Post #27

Post by Difflugia »

otseng wrote: Mon Jul 12, 2021 11:14 am That's correct. The reply button was code I added and not native to the phpbb software. And I couldn't figure out how to add notification to that.
Difflugia wrote: Mon Jul 12, 2021 1:13 pm There's a regular expression search on line 234 of phpBB3/includes/bbcode.php in the current code from the website (3.3.4) that matches a quotation with user ID. I'm betting that's the one used to send the notification.
Scratch that. It looks like the posts are stored in the database as XML documents. There's a function called "get_outermost_quote_authors" in phpBB3/phpbb/textformatter/s9e/utils.php that finds quoted authors in a XML document. It looks like it's only called by "find_users_for_notification" in phpBB3/phpbb/notification/type/quote.php. It's probably safe to change get_outermost_quote_authors, but I'm looking a little closer to try and figure out how it works.
My pronouns are he, him, and his.

User avatar
Difflugia
Prodigy
Posts: 3017
Joined: Wed Jun 12, 2019 10:25 am
Location: Michigan
Has thanked: 3247 times
Been thanked: 1997 times

Re: Not receiving notifications on some posts

Post #28

Post by Difflugia »

otseng wrote: Mon Jul 12, 2021 11:14 am That's correct. The reply button was code I added and not native to the phpbb software. And I couldn't figure out how to add notification to that.
I think if you add this to get_outermost_quote_authors in phpBB3/phpbb/textformatter/s9e/utils.php (or create a second function and make it a plugin or whatever; I don't know anything about your style), it will notify for the reply button. If you make a second function, it's called in find_users_for_notification in phpBB3/phpbb/notification/type/quote.php. I haven't tested it and it's based on a few guesses about how things work, but I'm optimistic. :)

Code: Select all

		foreach ($xpath->query('//URL[not(ancestor::QUOTE)]') as $url_text)
		{
			if (preg_match('/Replying to (.+)/', $url_text, $match))
			{
				$end_of_uname = strrpos($match[1], ' in post #', 0)
				if($end_of_uname !== false)
				{
					$authors[] = substr($match[1], 0, -$end_of_uname)
				}
			}
		}
This will find any "Reply to" URL that's not embedded within a quotation. The user names are validated elsewhere and checked for uniqueness, so that doesn't need to be done here. I'm not sure that "-$end_of_uname" is valid PHP or it will work right with names that include spaces. I think so on both counts, but I'm not positive.
My pronouns are he, him, and his.

User avatar
otseng
Savant
Posts: 20499
Joined: Thu Jan 15, 2004 1:16 pm
Location: Atlanta, GA
Has thanked: 197 times
Been thanked: 335 times
Contact:

Re: Not receiving notifications on some posts

Post #29

Post by otseng »

[Replying to Difflugia in post #29]

Thanks and added your code. Hopefully you'll get notified by this post.

User avatar
otseng
Savant
Posts: 20499
Joined: Thu Jan 15, 2004 1:16 pm
Location: Atlanta, GA
Has thanked: 197 times
Been thanked: 335 times
Contact:

Re: Not receiving notifications on some posts

Post #30

Post by otseng »

[Replying to Tcg in post #27]

Testing notification.

Post Reply