hynek-urban / rocketchat-async

asyncio-based Python wrapper for the Rocket.Chat Realtime API.
MIT License
13 stars 9 forks source link

Enable send_typing_event for threads #9

Closed kato-mahiro closed 4 months ago

kato-mahiro commented 5 months ago

Summary

This pull request implements an enhancement to the send_typing_event function, allowing it to send typing notifications not only to Rocket.Chat channels but also to specific threads within those channels.

Purpose

The current implementation of send_typing_event is limited to notifying about typing events at the channel level. For some applications, such as chatbots replying within threads, it is desirable to indicate typing events at the thread level. This update enables an optional thread_id parameter to be passed along with the channel_id to send_typing_event. If a thread_id is provided, the typing event will be directed to the specified thread. The behavior of the function without the thread_id remains unchanged.

Implementation Details

The change involves minor modifications to:

Backward compatibility has been maintained, ensuring that existing codebases using the send_typing_event function will continue to work as they did previously, without specifying a thread_id.

Testing & Compatibility

Testing was conducted on Rocket.Chat version 6.7.0, where the following behaviors were confirmed:


Your review and feedback on this addition would be greatly appreciated.

Best regards,

hynek-urban commented 4 months ago

@kato-mahiro Looks great, thank you! (And as usual, sorry for the somewhat longer turnaround time :) )