yii2-nfy icon indicating copy to clipboard operation
yii2-nfy copied to clipboard

poll action

Open makroxyz opened this issue 11 years ago • 4 comments

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

makroxyz avatar Sep 02 '14 13:09 makroxyz

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.

nineinchnick avatar Sep 02 '14 14:09 nineinchnick

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 avatar Sep 02 '14 14:09 makroxyz

@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.

nineinchnick avatar Feb 07 '15 18:02 nineinchnick

any news on that? @makroxyz

philippfrenzel avatar Apr 01 '15 20:04 philippfrenzel