Mark Derricutt's Disturbing Thoughts

My Top Tags

                                       

My Jaiku

The BGGA myth - Functional Java | Google Groups

Wednesday, 20 August 2008 7:33 A GMT+12

Spock's Beard – On A Perfect Day (live)

Wednesday, 20 August 2008 5:57 A GMT+12

Ola Bini: JtestR 0.3.1 Released

Tuesday, 19 August 2008 10:00 P GMT+12

Enslaved – Violet Dawning

Tuesday, 19 August 2008 6:14 A GMT+12

Distributed Messaging with Jetlang and Terracotta

Monday, 18 August 2008 10:17 P GMT+12

The Music of 2008 - week 33

Monday, 18 August 2008 8:57 A GMT+12

There Can Be Only One

Monday, 18 August 2008 8:10 A GMT+12

Silent Force – Point Of No Return

Monday, 18 August 2008 6:30 A GMT+12

In Relation To...  Hibernate Core 3.3.0 goes GA

Saturday, 16 August 2008 7:03 P GMT+12

Search Box

 

Dolphin XMPP Message Sending

posted Monday, 27 September 2004
I'm starting to get something of a more working/functional set of classes to drive XMPP/Jabber from Dolphin Smalltalk. Now at the point that I need to think about HOW I want to use XMPP from Dolphin; how the API should look and be used.

From a fresh workspace, the following code sends my main client instance a chat message after successfully binding and authenticating to the jabber server.

| xmpp |
xmpp := XMPPConnection new.
xmpp jid: 'talios@myjabber.net'.
xmpp password: '********'.
xmpp resource: 'Dolphin'.
xmpp bind ifTrue: 
  [xmpp login ifTrue:
    [ xmpp sendChatMessage: 'hello mark from dolphin smalltalk'
      to: 'talios@myjabber.net/Pandion'.]]

The current library is quite flat with everything sitting on the XMPPConnection class, however I'm thinking of breaking things apart to allow something like the following:

chat := xmpp openChatTo: 'talios@myjabber.net/Pandion'.
chat onIncomingMessageDo: [ :message |
  message inspect.].
chat newMessage: 'Hello XMPP';
  send.
This would open a new chat to the specified jid, setup a callback handler/block to respond to chat message replies from this jid with simply "inspects" the incoming message, then make an initial message to the user and send it.

Michael Lucas-Smith of Software With Style has expressed an interest in seeing my XMPP packages appearing for Cincom Visual Works Smalltalk, which I'll definitely be looking into once I've got my head around this current Dolphin implemtation.

links: digg this    del.icio.us    technorati    reddit




1. a reader left...
Saturday, 16 October 2004 8:13 pm

Very nice looking client. Is it functional yet, and if so, where do I get it? :D

Chris

Chris [chris@growl.info]