0
我想處理使用以下處理程序SleekXMPP不處理標題類型的消息(Openfire的)
self.add_event_handler("message", self.onmessage)
而且方法,由SleekXMPP客戶端(從Openfire的)接收的所有郵件
def onmessage(self,msg):
打印( '我在onmessages .. !!') 如果MSG [ '類型'〕中( '錯誤', '標題', '羣聊'): 打印 「%S」 %MSG
我可以打印類型爲「groupchat」的郵件,但是當我收到類型爲「標題」的郵件時,我沒有收到任何打印出來的郵件。
我已驗證我的連接是通過啓用DBUG模式接收這些消息。
任何想法爲什麼我的消息處理程序不處理標題消息?
EX. groupchat message i got (which is successfully processed by the handler)
<message to="[email protected]/resource" type="groupchat" id="m_444"
from="[email protected]/Chatadmin1 HOST"><body>user06</body>
<html xmlns=""><body xmlns="">user06</body></html></message>"
EX. headline message I want to process with the same handler (which is not working ATM)
<message to="[email protected]/resource" type="headline" from="chat">
<x xmlns="domain:mute">
<mute duration="5" reasonCode="mute.reason.swearing" expiryTime="1416483206670" />
</x></message>
提前一個的解釋/溶液非常感謝)
是不是SleekXMPP開源?如果是這樣,你不能只看源代碼並調試它,看看標題類型消息發生了什麼? – Flow 2014-11-21 14:03:09
@Flow:我完全同意你的看法,但不幸的是,我最近開始自學python。儘管如此,我仍然試圖查看代碼,但無法完全理解,因此發佈在堆棧溢出上。無論如何非常感謝您的建議。 – 2014-11-21 18:58:44
好吧,我真的建議利用開源的力量。解決這些問題也是最好的學習方式。 – Flow 2014-11-21 20:09:07