1

I am missing the some custom attribute in smack message stanza like example

This stanza is server sending :

<message to='me' from='someone' id='18' xml:lang='en' type='chat'><body>X</body><thread>7067c261-1987-429e-89c0-ced23cf3514b</thread><mycustomtag xmlns='urn:xmpp:mycustomtag' mid='18' deptID='3' visitorName='me' csId='someid'/></message>

But I am getting mycustomtag attribute like this is the mesaage stanza I am getting

<message to='me' from='someone' id='18' xml:lang='en' type='chat'><body>X</body><thread>7067c261-1987-429e-89c0-ced23cf3514b</thread><mycustomtag xmlns='urn:xmpp:mycustomtag' /></message>

This is what i am getting in my log.Can some one pls help me.

This is where in and receiver Message Stanza :

 chatmanager.addChatListener(new ChatManagerListener() {
        @Override
        public void chatCreated(Chat chat, boolean createdLocally) {
            chat.addMessageListener(new ChatMessageListener() {
                @Override
                public void processMessage(Chat chat, final Message message) {
prem nath
  • 75
  • 1
  • 12
  • add your code to intercept and parse your tag please – MrPk Oct 27 '16 at 09:26
  • this is the message receiving code which i m using : chatmanager.addChatListener(new ChatManagerListener() { @Override public void chatCreated(Chat chat, boolean createdLocally) { chat.addMessageListener(new ChatMessageListener() { Override public void processMessage(Chat chat, final Message message) { – prem nath Oct 27 '16 at 09:55
  • which server? openfire? – Farhan Oct 30 '16 at 10:41
  • these logs. are these from smack library or your log in processMessage? – Farhan Oct 30 '16 at 10:52

1 Answers1

0

Essentialy, if you do not manage Extension Elements in server, when it found one just copies the structure so the client as reply will found nothing but tag.

You have to validate the data in server (in your case copy also attributes and text). I made a resume if you use Openfire.

Mapping Openfire Custom plugin with aSmack Client

Community
  • 1
  • 1
MrPk
  • 2,862
  • 2
  • 20
  • 26