zulip / zulip

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
https://zulip.com
Apache License 2.0
21.29k stars 7.7k forks source link

Add a time filter #31784

Open Charlies-Kvit opened 3 days ago

Charlies-Kvit commented 3 days ago

To more accurately filter the user's last activity (or rather messages), you can add another time parameter. For example, so that the api can make a selection from the database from January 1, 2023 to February 31 of the same year. This is just an example.

tasfia8 commented 23 hours ago

Hello Charlie! I am a 4th year Computer Engineering Student. I want to find a good first issue that I have to complete for my school project. The project is: working on a good first issue successfully and the owner merges the request at the end. Would you be able to guide me through this? Thanks.

Is this a good first issue for beginners? What's the difficulty level? Could I be assigned this issue?

Charlies-Kvit commented 1 hour ago

Hello Charlie! I am a 4th year Computer Engineering Student. I want to find a good first issue that I have to complete for my school project. The project is: working on a good first issue successfully and the owner merges the request at the end. Would you be able to guide me through this? Thanks.

Is this a good first issue for beginners? What's the difficulty level? Could I be assigned this issue?

Hi, @tasfia8! Yes, I can help you. Look, there is the following method. Here is the documentation on the page: https://chat.zulip.org/api/get-messages . I want there to be two more operands: start_time, that is, the time FROM which to search and end_time, that is, to which to search. The arguments are the time in timestamp format. Roughly speaking, it's just filtering by time. For example:

request: dict[str, Any] = {
    "anchor": "newest",
    "num_before": 100,
    "num_after": 0,
    "narrow": [
        {"operator": "sender", "operand": "iago@zulip.com"},
        {"operator": "channel", "operand": "Verona"},
        {"operator": "start_time", "operand": 123242},
        {"operator": "end_time", "operand":  9124812}
    ],
}

If you have any more questions, please. Thank you for responding.