mirror of
				https://github.com/pragma-/pbot.git
				synced 2025-10-31 14:47:27 +01:00 
			
		
		
		
	Show only chat messages in recall surrounding context (no joins/quits/etc)
				
					
				
			This commit is contained in:
		
							parent
							
								
									340cf07558
								
							
						
					
					
						commit
						f8b6b19398
					
				| @ -450,13 +450,13 @@ sub get_message_context { | ||||
|     $messages_before = eval { | ||||
|       my $sth; | ||||
|       if (defined $context_id) { | ||||
|         $sth = $self->{dbh}->prepare('SELECT id, msg, mode, timestamp, channel FROM Messages WHERE id = ? AND channel = ? AND timestamp < ? AND mode != 1 ORDER BY timestamp DESC 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(2, $message->{channel}); | ||||
|         $sth->bind_param(3, $message->{timestamp}); | ||||
|         $sth->bind_param(4, $before); | ||||
|       } else { | ||||
|         $sth = $self->{dbh}->prepare('SELECT id, msg, mode, timestamp, channel FROM Messages WHERE channel = ? AND timestamp < ? AND mode != 1 ORDER BY timestamp DESC 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(2, $message->{timestamp}); | ||||
|         $sth->bind_param(3, $before); | ||||
| @ -471,13 +471,13 @@ sub get_message_context { | ||||
|     $messages_after = eval { | ||||
|       my $sth; | ||||
|       if (defined $context_id) { | ||||
|         $sth  = $self->{dbh}->prepare('SELECT id, msg, mode, timestamp, channel FROM Messages WHERE id = ? AND channel = ? AND timestamp > ? AND mode != 1 LIMIT ?'); | ||||
|         $sth  = $self->{dbh}->prepare('SELECT id, msg, mode, timestamp, channel FROM Messages WHERE id = ? AND channel = ? AND timestamp > ? AND mode = 0 LIMIT ?'); | ||||
|         $sth->bind_param(1, $context_id); | ||||
|         $sth->bind_param(2, $message->{channel}); | ||||
|         $sth->bind_param(3, $message->{timestamp}); | ||||
|         $sth->bind_param(4, $after); | ||||
|       } else { | ||||
|         $sth  = $self->{dbh}->prepare('SELECT id, msg, mode, timestamp, channel FROM Messages WHERE channel = ? AND timestamp > ? AND mode != 1 LIMIT ?'); | ||||
|         $sth  = $self->{dbh}->prepare('SELECT id, msg, mode, timestamp, channel FROM Messages WHERE channel = ? AND timestamp > ? AND mode = 0 LIMIT ?'); | ||||
|         $sth->bind_param(1, $message->{channel}); | ||||
|         $sth->bind_param(2, $message->{timestamp}); | ||||
|         $sth->bind_param(3, $after); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Pragmatic Software
						Pragmatic Software