powered by Jive Software

Specifying subject and body in Chat.java

I found that if I want to specify the subject of a Message I have to send the message sendMessage(Message) to aChat where the parameter has to be initialized with the subject (among other parameters).

In my opinion when a new Chat is created the first message sent will probably specify the subject together with the body. Therefore, I think that it will be useful to add the message sendMessage(String, String) to Chat.

Code example below:

public void sendMessage(String body) throws XMPPException {
          sendMessage(null, body)
     }      public void sendMessage(String subject, String body) throws XMPPException {
          Message message = createMessage();
          message.setSubject(subject);
          message.setBody(body);
          connection.sendPacket(message);
     }

– Gato

Gato,

I’'ve found that people very rarely use the subject when sending XMPP messages (especially for chats). If you and others think otherwise, let me know!

-Matt

Matt,

To be honest this is my first time I play with XMPP. I have always used MSN or ICQ. I was trying to learn the Smack API and I used the Exodus client as a GUI to guide me. The Exodus has the menu item “Send Instant Message” where you can specify the subject and body of the message. Therefore, I thought that this could be an interesting thing to have.

Regards,

– Gato

Gato,

I find Exodus’’ “Send IM” feature a bit confusing because it presents 1-to-1 chatting in an email style interface where subject makes sense. However, I think most people assume 1-to-1 chat in IM should use the line-by-line chat style (that doesn’‘t use subject). So the unexpected behavior can throw users off; usually not a good thing. I think most clients try to work it in just because you can; a trend I’'m not too fond of.

The one place where message subjects are used with regularity is setting the room topic in groupchat. The subject field in the last message with a subject sets the room topic (usually displayed in the title bar of the chatroom in most clients). However, this is not a common usage of Message so the simple interface to message sending may be better (keep the API clean), leaving the rare use of subject to the more verbose manipulation of Message objects…

Let me know your thoughts.

-iain

Iain,

I completely agree with you. I’'ve always used MSN and ICQ for IM and never specified a subject for the instant chat. I like the idea of keeping the API clean and extend it according the needs.

Since this is the first time I play with XMPP, my initial thoughts were that may be the subject was a usual thing to have but as far as I can see it’'s not.

BTW, I don’‘t know why my watch on this thread was deleted. I realized that the watch was missing because I didn’'t receive an email when you replied to the thread.

Regards,

– Gato

BTW, I don’'t know why my watch on this thread was

deleted. I realized that the watch was missing

because I didn’'t receive an email when you replied to

the thread.

Hmm. If you see this happen again, please report it in the Jive Forums support forum.

thanks

-iain