Skip to content

Commit

Permalink
Filter to display inbound messages only
Browse files Browse the repository at this point in the history
  • Loading branch information
mdrxy committed Oct 30, 2024
1 parent 4f29d5a commit ee4bdfe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dashboard_defs/twilio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ impl Updatable for TwilioStateData {
let time_sent = DateTime::parse_from_rfc2822(unparsed_time_sent).unwrap();

// TODO: see that the manual date filtering logic works
if time_sent >= history_cutoff_time {
if time_sent >= history_cutoff_time && message_field("direction") == "inbound" {
let id = message_field("uri");

// If a key on the heap already existed, reuse it
Expand Down

3 comments on commit ee4bdfe

@CaspianA1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work in all cases. It will need to be amended.

Basically, the code first requests N messages. Some might be inbound, and some might be outbound. If you only take inbound messages, and then e.g. 3 are outbound in the ones you got, you then only got N - 3 messages. There's no way to filter by inbound or outbound as a request parameter, so a system will have to be developed to re-request messages until enough inbound ones have been received.

@mdrxy
Copy link
Member Author

@mdrxy mdrxy commented on ee4bdfe Nov 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is also a case where a text is received with an empty Body, e.g. in the case someone sends a media item. In these cases we could either omit the message completely, or insert a message such as "An image was sent, but we can't display it here (yet)..."

Speaking of media, #35

@CaspianA1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handling this now.
Image

Please sign in to comment.