Skip to content

[ticket/17343] Display push notifications in user language#6693

Merged
marc1706 merged 3 commits intophpbb:masterfrom
marc1706:ticket/17343
Oct 3, 2024
Merged

[ticket/17343] Display push notifications in user language#6693
marc1706 merged 3 commits intophpbb:masterfrom
marc1706:ticket/17343

Conversation

@marc1706
Copy link
Member

@marc1706 marc1706 commented Jul 17, 2024

PHPBB-17343

Checklist:

  • Correct branch: master for new features; 3.3.x for fixes
  • Tests pass
  • Code follows coding guidelines: master and 3.3.x
  • Commit follows commit message format

Tracker ticket:

https://tracker.phpbb.com/browse/PHPBB-17343

@rxu
Copy link
Contributor

rxu commented Jul 17, 2024

For the extension we did it this way phpbb-extensions/webpushnotifications#65 if it makes any sense.

@marc1706
Copy link
Member Author

For the extension we did it this way phpbb-extensions/webpushnotifications#65 if it makes any sense.

One of the reasons want to do this in the controller is to prevent having to reload language multiple times while sending out notifications.

@iMattPro
Copy link
Member

One thing to maybe add to this, although not totally related, is Emoji support. Apparently if Emoji's are in the notification's body/message (such as from a PM or Topic title), they appear as something like 😆 instead of 😆

@marc1706
Copy link
Member Author

One thing to maybe add to this, although not totally related, is Emoji support. Apparently if Emoji's are in the notification's body/message (such as from a PM or Topic title), they appear as something like 😆 instead of 😆

Thanks for the info, that should also be fixed :)

@iMattPro
Copy link
Member

We did this: phpbb-extensions/webpushnotifications#82

@marc1706
Copy link
Member Author

marc1706 commented Sep 30, 2024

Also ended up with that:
image
(Not sure yet why it shows by Anonymous)

@marc1706
Copy link
Member Author

marc1706 commented Oct 1, 2024

Usernames are also correctly displayed now.

@marc1706 marc1706 added this to the 4.0.0-a1 milestone Oct 1, 2024
@iMattPro
Copy link
Member

iMattPro commented Oct 1, 2024

Are there any pros/cons to storing the rendered emoji in the DB like this is doing now vs. storing it as hex code like before and decoding it when sending the push notification out?

Also it working for me too
Screenshot 2024-10-02 at 7 15 09 AM

$notification = $this->notification_manager->get_item_type_class($row_data['notification_type_name'], $row_data);

// Load users for notification
$this->user_loader->load_users($notification->users_to_query());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should you add [USER_IGNORE] as 2nd parameter here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that's needed and also not what is done in the board notifications.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just asking because we use this same method in the other webpush class (the method class) and there we are using the 2nd parameter with USER_IGNORE

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though that is before creating the notification. Here it's about displaying it correctly so there shouldn't be any of these left.

@marc1706
Copy link
Member Author

marc1706 commented Oct 2, 2024

Are there any pros/cons to storing the rendered emoji in the DB like this is doing now vs. storing it as hex code like before and decoding it when sending the push notification out?

Also it working for me too Screenshot 2024-10-02 at 7 15 09 AM

We're storing the notification data the same way we're storing it for board notifications so I think it's fine to leave it like this.

@marc1706 marc1706 removed the WIP 🚧 label Oct 2, 2024
@iMattPro
Copy link
Member

iMattPro commented Oct 2, 2024

Are there any pros/cons to storing the rendered emoji in the DB like this is doing now vs. storing it as hex code like before and decoding it when sending the push notification out?
Also it working for me too Screenshot 2024-10-02 at 7 15 09 AM

We're storing the notification data the same way we're storing it for board notifications so I think it's fine to leave it like this.

Are we? I remember looking in a DB entry for the _notifications table and seeing the emoji as hex codes in there.

@marc1706
Copy link
Member Author

marc1706 commented Oct 3, 2024

Are there any pros/cons to storing the rendered emoji in the DB like this is doing now vs. storing it as hex code like before and decoding it when sending the push notification out?
Also it working for me too Screenshot 2024-10-02 at 7 15 09 AM

We're storing the notification data the same way we're storing it for board notifications so I think it's fine to leave it like this.

Are we? I remember looking in a DB entry for the _notifications table and seeing the emoji as hex codes in there.

You can compare the contents of the created notifications for these examples in the database. I've opted to generally use the same way of storing these so there shouldn't be a big difference.

@marc1706 marc1706 merged commit ae8a5e7 into phpbb:master Oct 3, 2024
@marc1706 marc1706 deleted the ticket/17343 branch October 3, 2024 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants