krille-chan / fluffychat

The cutest instant messenger in the [matrix]
https://fluffychat.im/
GNU Affero General Public License v3.0
1.08k stars 185 forks source link

Calls doesn't work #1313

Open galizhan opened 2 weeks ago

galizhan commented 2 weeks ago

Bug Description

Hi there is problem with outcomming calls, It just hanging up after 1 second.

Steps to Reproduce

  1. Open Chat
  2. Call to any contact

Expected Behavior

it should call

App Version

1.22

Additional Platform Information

Iphone 11 and Android One Plus

Additional Context

No response

cturn-dev commented 5 days ago

Same issue here

cturn-dev commented 2 days ago

It seems that the userId might be missing in the inviteToCall function call, potentially causing the system to call the user themselves. As a result, the user appears as busy, and the call gets disconnected. I suggest the following workaround to address this issue, but I would appreciate it if the developers could take a closer look at the root cause of the problem.

--- chat.dart~  2024-09-16 17:30:43.148395758 +0200
+++ chat.dart   2024-09-16 17:34:05.626264195 +0200
@@ -1299,7 +1299,7 @@

     final voipPlugin = Matrix.of(context).voipPlugin;
     try {
-      await voipPlugin!.voip.inviteToCall(room, callType);
+      await voipPlugin!.voip.inviteToCall(room, callType, userId: room.directChatMatrixID);
     } catch (e) {
       ScaffoldMessenger.of(context).showSnackBar(
         SnackBar(content: Text(e.toLocalizedString(context))),