Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
* [sup-talk] ignore replies when calculating thread date
@ 2013-07-01 19:47 Steven Schmeiser
  2013-07-01 22:26 ` Matthieu Rakotojaona
  0 siblings, 1 reply; 3+ messages in thread
From: Steven Schmeiser @ 2013-07-01 19:47 UTC (permalink / raw)
  To: sup-talk

Hi all,
Is there an option to ignore replies when calculating the date of a thread?  I would like it if replying to a thread did not bump it to the top of the index.

Cheers,
Steve

_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [sup-talk] ignore replies when calculating thread date
  2013-07-01 19:47 [sup-talk] ignore replies when calculating thread date Steven Schmeiser
@ 2013-07-01 22:26 ` Matthieu Rakotojaona
  2013-07-02 12:39   ` Steven Schmeiser
  0 siblings, 1 reply; 3+ messages in thread
From: Matthieu Rakotojaona @ 2013-07-01 22:26 UTC (permalink / raw)
  To: sup-talk


[-- Attachment #1.1: Type: text/plain, Size: 891 bytes --]

Excerpts from Steven Schmeiser's message of 2013-07-01 21:47:36 +0200:
> Is there an option to ignore replies when calculating the date of a
> thread?  I would like it if replying to a thread did not bump it to
> the top of the index.

Basically, you would like to change the sorting order from
date-of-last-message to date-of-first-message ?

There is nothing currently implemented for this, at least that I know
of. If you're aventurous enough, you can have some option modify the
ThreadSet#sort_key method. Here's the current content:

```
def sort_key
  m = latest_message
  m ? [-m.date.to_i, m.id] : [-Time.now.to_i, ""]
end
```

Pretty straightforward, you'd have to fetch first_message and keep the
same logic.

However, if you only want to keep the same order independently from
_your_ replies, I don't know how you would do it.

-- 
Matthieu Rakotojaona

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 140 bytes --]

_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [sup-talk] ignore replies when calculating thread date
  2013-07-01 22:26 ` Matthieu Rakotojaona
@ 2013-07-02 12:39   ` Steven Schmeiser
  0 siblings, 0 replies; 3+ messages in thread
From: Steven Schmeiser @ 2013-07-02 12:39 UTC (permalink / raw)
  To: sup-talk

I meant your second interpretation: keep the same order, but not have
*my* sent messages enter into the date calculation.  Maybe it would be
possible to create a "latest_received_message" and use that in the sort
key.

Maybe this will get me to learn a little Ruby...
 
> Excerpts from Steven Schmeiser's message of 2013-07-01 21:47:36 +0200:
> > Is there an option to ignore replies when calculating the date of a
> > thread?  I would like it if replying to a thread did not bump it to
> > the top of the index.
> 
> Basically, you would like to change the sorting order from
> date-of-last-message to date-of-first-message ?
> 
> There is nothing currently implemented for this, at least that I know
> of. If you're aventurous enough, you can have some option modify the
> ThreadSet#sort_key method. Here's the current content:
> 
> ```
> def sort_key
>   m = latest_message
>   m ? [-m.date.to_i, m.id] : [-Time.now.to_i, ""]
> end
> ```
> 
> Pretty straightforward, you'd have to fetch first_message and keep the
> same logic.
> 
> However, if you only want to keep the same order independently from
> _your_ replies, I don't know how you would do it.
> 
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-07-02 12:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-01 19:47 [sup-talk] ignore replies when calculating thread date Steven Schmeiser
2013-07-01 22:26 ` Matthieu Rakotojaona
2013-07-02 12:39   ` Steven Schmeiser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox