`
langzhe
  • 浏览: 286324 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

ejaberd_s2s presence bug

 
阅读更多

 

    presence_broadcast_first(From, NewStateData, Packet);
   和生成的NewState 未使用,导致 当订阅状态为from 和to的时候。且to 先上线,from 再上线,from 再下线时。to没有收到
<presence type='unavailable'/> ,实际上是from 没有发送引起的。

 

1740             NewState =
1741                 NewStateData = StateData#state{pres_last = Packet,
1742                                                pres_invis = false,            
1743                                                pres_timestamp = Timestamp},   
1744                 if
1745                     FromUnavail ->                 
1746                         ejabberd_hooks:run(user_available_hook,
1747                                            NewStateData#state.server,     
1748                                            [NewStateData#state.jid]),     
1749                         if NewPriority >= 0 ->                                                                                                          
1750                                 resend_offline_messages(NewStateData),
1751                                 resend_subscription_requests(NewStateData);
1752                            true ->                        
1753                                 ok                             
1754                         end,
1755                         presence_broadcast_first(From, NewStateData, Packet);
1756                     true ->
1757                         presence_broadcast_to_trusted(NewStateData,
1758                                                       From,                          
1759                                                       NewStateData#state.pres_f,     
1760                                                       NewStateData#state.pres_a,     
1761                                                       Packet),                       
1762                         if OldPriority < 0, NewPriority >= 0 ->
1763                                 resend_offline_messages(NewStateData);
1764                            true ->                        
1765                                 ok                             
1766                         end,
1767                         NewStateData                   
1768                 end,
1769             NewState
1770     end.
1
1
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics