mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-30 07:59:42 +01:00
MessageHistory: fix sort for -A option
This commit is contained in:
parent
20a7ff992d
commit
84ec0841c2
@ -948,13 +948,13 @@ sub get_message_context {
|
|||||||
$messages_after = eval {
|
$messages_after = eval {
|
||||||
my $sth;
|
my $sth;
|
||||||
if (defined $context_id) {
|
if (defined $context_id) {
|
||||||
$sth = $self->{dbh}->prepare('SELECT id, msg, mode, timestamp, channel FROM Messages WHERE id = ? AND channel = ? AND timestamp > ? AND mode = 0 LIMIT ?');
|
$sth = $self->{dbh}->prepare('SELECT id, msg, mode, timestamp, channel FROM Messages WHERE id = ? AND channel = ? AND timestamp > ? AND mode = 0 ORDER BY timestamp DESC LIMIT ?');
|
||||||
$sth->bind_param(1, $context_id);
|
$sth->bind_param(1, $context_id);
|
||||||
$sth->bind_param(2, $message->{channel});
|
$sth->bind_param(2, $message->{channel});
|
||||||
$sth->bind_param(3, $message->{timestamp});
|
$sth->bind_param(3, $message->{timestamp});
|
||||||
$sth->bind_param(4, $after);
|
$sth->bind_param(4, $after);
|
||||||
} else {
|
} else {
|
||||||
$sth = $self->{dbh}->prepare('SELECT id, msg, mode, timestamp, channel FROM Messages WHERE channel = ? AND timestamp > ? AND mode = 0 LIMIT ?');
|
$sth = $self->{dbh}->prepare('SELECT id, msg, mode, timestamp, channel FROM Messages WHERE channel = ? AND timestamp > ? AND mode = 0 ORDER BY timestamp DESC LIMIT ?');
|
||||||
$sth->bind_param(1, $message->{channel});
|
$sth->bind_param(1, $message->{channel});
|
||||||
$sth->bind_param(2, $message->{timestamp});
|
$sth->bind_param(2, $message->{timestamp});
|
||||||
$sth->bind_param(3, $after);
|
$sth->bind_param(3, $after);
|
||||||
|
Loading…
Reference in New Issue
Block a user