For the quickest reply, please use our new Customer Helpdesk and Feedback platform
 
   
 
Record #received_packet from attribute
Posted: 21 April 2010 10:43 PM   [ Ignore ]
Junior Member
Avatar
RankRank
Total Posts:  38
Joined  2009-11-19

Trying to use the ‘from’ attribute as a #jid, but no success.

Using a #received_packet{from=From}
trying: exmpp_jid:is_jid(From)
returns: false

How to use the information provided by #received_packet as a jid()?

Profile
 
 
Posted: 27 April 2010 07:03 PM   [ Ignore ]   [ # 1 ]
Moderator
RankRank
Total Posts:  31
Joined  2009-06-04

Hi,  it is a tuple with three elements {Node, Domain, Resource}.

If you want to have a full jid() record from it,  both of the following will work::

A) #received_packet{from=From}
  FromJID = exmpp_jid:make(From)


B) #received_packet{from = {Node, Domain, Resource}}
    FromJID = exmpp_jid:make(Node, Domain, Resource)

Profile