簡體   English   中英

如果接收者用戶離線,則通過 Ejabberd Api 的 send_message 端點發送時未收到消息

[英]Message not received when sent through send_message endpoint of Ejabberd Api if the receiver user was offline

我正在實現聊天應用程序,但我不明白為什么當我使用 ejabberd 的模塊Send_message時,接收者看不到消息。

我是說:

  • 用戶 B 離線,用戶 A 使用 ejabberd api 通過 https 發送消息。 **

  • 當用戶 B 上線時,他什么也看不到 ***

我在客戶端使用 smack 並實現了傳入消息的偵聽器。 但我沒有看到帶有消息擴展名的傳入數據包

我無法重現該問題。

這就是我測試它的方式:

  1. 安裝ejabberd 21.04,默認配置,啟動

  2. 注冊賬戶 user1@localhost 和 user2@localhost

  3. 使用 shell 發送消息(無需設置 API):

    ❯ ejabberdctl send_message chat user1@localhost user2@localhost somesubject 某人

  4. 然后使用一個好的桌面 Jabber 客戶端登錄到賬戶 user2@localhost,例如 Gajim, Psi, Tkabber, ... 登錄后,客戶端收到

 <message to='user2@localhost' from='user1@localhost' type='chat' id='13012384106679348680'> <archived by='user2@localhost' id='1621974627878891' xmlns='urn:xmpp:mam:tmp'/> <stanza-id by='user2@localhost' id='1621974627878891' xmlns='urn:xmpp:sid:0'/> <delay from='localhost' stamp='2021-05-25T20:30:27.879994Z' xmlns='urn:xmpp:delay'>Offline storage</delay> <body>somebody</body> <subject>somesubject</subject> </message>

你必須嘗試的事情:

  • 您的客戶必須登錄,以積極的優先級發送出席信息,才能接收離線消息。
  • 嘗試使用 Jabber 客戶端接收消息,可能問題出在您的客戶端。
  • 並嘗試使用 ejabberdctl 腳本。 也許問題出在您的 API 調用方法中。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM