Send IM from webpage

Perhaps because I don’‘t understand JAVA at all, I’‘m totally lost, but I can’'t figure out how to use this at all.

I just want to send an IM to someone via a form on a web page. I envision a drop down where you can select the person to send the IM to and a box to type the IM in.

I’'m totally lost as to how Smack helps me do this.

Any help?

Hi,

you could write a simple servlet which uses Smack to offer such a feature.

Maybe you want to try another hard way, JWChat is a web based jabber client, together with Tomcat and wildfire.war it is easy to install.

It also offers JEP-0124 (HTTP Binding), to use this directly instead of JWChat you will need to code some javascript.

LG

Well, unfortunately, wrting a small servlet is out of my relm at the moment.

Not sure I want to start mixing and matching clients with Spark and JWChat, as my user base will probably just get confused.

Is there a way to make it so I can click on a link and it opens Spark to send an IM with this Smack stuff?

Hi,

would you please explain the use case? I assumed that only a few people (admins, helpdesk) want to have a web page where they login and then send some messages without receiving an answer.

Spark uses the Smack API to send the messages to the jabber server - you’'ll likely use either Spark or Smack.

Maybe you can live with one of these out-of-the-box options:

It is possible to open Spark using WebStart (like http://liveassist.jivesoftware.com/im/app/spark.jnlp in the jnlp file the username , password, server, jids and muc may be stored ).

Or you can create a Shortcut to Spark like:

“Spark.exe” "username=user&password=pwd&server=jabber

.org&start_chat_muc=Conference&start_chat_jid=admin@jabber.org"

which will open a MUC and a normal chat room.

Both options don’'t allow to supply a message and the users could start Spark 10 times …

LG

You are right. I thought about it a bit more and it is dumb to send a message and not get an answer in return.

Thinking about it now, I’‘d like a way to have a user’'s name displayed on a web page and have that name hyperlinked to open a chat when someone clicks on their name.

So if some one clicked my name, ewto16[/u], that would pop open Spark with a chat setup to go to me.

Is that possible?

Thanks for your help so far.

Hi Eric,

currently this is not really possible. Maybe with the 7th Feb release such a feature will become available (“This has been planned for the 1.1 release.”) . See http://www.jivesoftware.org/community/thread.jspa?messageID=111221 for details.

Of course you can use regedit and define that xmpp: URL’'s open Spark, but this would lead to 2, 3, … instances of Spark running (while only one can be connected) because currently Spark does not recognize that it is already running.

LG

Ok, well I’'ll wait to see if it is handeled in the 1.1 release. Something to look forward to next week.