File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -53,12 +53,14 @@ function RenderState:get_part(part_id)
5353 return self ._parts [part_id ]
5454end
5555
56- --- Get part ID by call ID
56+ --- Get part ID by call ID and message ID
5757--- @param call_id string Call ID
58- --- @param message_id ? string Optional message ID to limit search scope
58+ --- @param message_id string Message ID to check the parts of
5959--- @return string ? part_id Part ID if found
6060function RenderState :get_part_by_call_id (call_id , message_id )
6161 local rendered_message = self ._messages [message_id ]
62+ -- There aren't a lot of parts per message and call_id lookups aren't very common so
63+ -- a little iteration is fine
6264 if rendered_message and rendered_message .message and rendered_message .message .parts then
6365 for _ , part in ipairs (rendered_message .message .parts ) do
6466 if part .callID == call_id then
You can’t perform that action at this time.
0 commit comments