yii2-nfy
yii2-nfy copied to clipboard
poll action
Hi I've forked this project and it's very useful to me. I'd like to know why actionPoll retrieves (and so deletes) messages instead peek them. Messages widget should be feed with peek (there is a 'mark as read' link which logical deletes message)... but If you want to feed widget ajax call to actionPoll... messages will be all deleted every time.
Am I wrong? Is there something I don't undestand?
Thanks in advance
There is no way of marking messages as read so they're just removed from a queue. I usually use two queues, one for popup notifications and a second one for toolbar-icon-notifications, which are removed from the queue only when clicked on. That second one is not powered using ajax.
Probably actionPoll could use some kind of a switch or param.
PS If you have any new features or bugfixes in your fork a pull request would be very welcomed.
Ok thank you. I was implementing the poll action with a new parameter for peeking messages. I'd like if you try my code, would be great to have your feedback. I did a bit of modifications around, now I'm going to write widget.
Did you implement your in that way, isn't it?
$widget = new \nineinchnick\nfy\widgets\Messages(['id' => 'widget', 'messages' => ['dbmq' => Yii::$app->dbmq->peek(Yii::$app->user->id)]]);
$menuItem = $widget->createMenuItem();
$widget->run();
@makroxyz can you update your branch? I've run php-cs-fixer on this and would like to compare and merge your changes or at least parts of them.
any news on that? @makroxyz