What does 'recent' mean in 'recent conversations'

What does 'recent' mean in 'recent conversations'

by Howard Miller -
Number of replies: 4
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I've had some complaints about the 'recent conversations' not showing everything it should. 

It's not clear - for a start - how 'recent' is defined. Having dug into the code I find an unreadable SQL query (why-oh-why etc.) that doesn't help at all. However, I can see that it should be displaying messages from the 'mdl_message_read' table but it seems to be displaying only some 'random' selection of the messages in the table (even taking into consideration multiple messages from the same user - it should only show the most recent).  

Average of ratings: -
In reply to Howard Miller

Re: What does 'recent' mean in 'recent conversations'

by Colin Fraser -
Picture of Documentation writers Picture of Testers

So, you are suggesting the selection criteria should be based on a time/date frame rather than random?...cool idea.

In reply to Colin Fraser

Re: What does 'recent' mean in 'recent conversations'

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I don't know.... is it random?

I spent half-an-hour staring at another monster bit of SQL trying to figure out what it did and I still have no clue. I wish devs wouldn't do this sort of thing. I'd much rather trade a little bit of performance for code that someone had a clue of understanding - rant rant. 

Having said that, to me, 'recent' does imply 'stuff that happened since some arbitrary date' and that does not appear to be how this list is selected. 

In reply to Howard Miller

Re: What does 'recent' mean in 'recent conversations'

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Well, my SQL is a little rusty, and I am too lazy to go searching for the code, want to let me know where it is and I will try to pick it apart.. going to have a little time over the next two months or years or so,  or just message the code, and I should be able to figure out what tables it is using, at least, and perhaps suggest how it is selecting its data. Cheers...

In reply to Colin Fraser

Re: What does 'recent' mean in 'recent conversations'

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

My SQL is actually quite good and I was stumped (in that I couldn't see why it was missing some messages). Still, you're very welcome.

Look in message/lib.php and find the function 'message_get_recent_conversations()' - round about line 700 in 2.7.3

Good luck big grin