Jabber [no longer] Missing

Julian Fitzell julian at beta4.com
Wed Aug 31 11:24:21 UTC 2005


Quoting Tony Garnock-Jones <tonyg at lshift.net>:

> Julian Fitzell wrote:
> > And I should really dig out my server code and the changes I made to your 
> > library and put them out there. 
> 
> Please do! I've been working on a Smalltalk Jabber server myself, and 
> since it was the first Smalltalk program of any size I ever wrote, I'd 
> love to see where I went wrong and learn better idiom.

He he... well, I've done it.  It was actually easier to get work than I 
expected since many of the dependencies I had last year have now been included 
in Squeak.

By the way, looking at this code reminded me how much I wanted traits when I 
was first writing it.  Jabber has all these protocol elements, many of which 
share various attribute sets but not in a single inheritance fashion.  I was 
playing all kinds of games to build up a class hierarchy representing these 
elements and it wasn't much fun.  If I do decide to keep working on this, I 
think I'll try to see how it improves with the addition of Traits.

So here's what you do:

- grab a 3.8 image
- head over to www.squeaksource.com and find the Jabber project
- install the KomServices package there (Göran, I have a version that removes 
the use of Dynamic Bindings and adds a pluggable service... I can merge the 
changes into your new package if you're interested)
- install the Jabber package
- get a server running:

JBSRouter default addServiceOfClass: JBSClientService identifier: 'localhost'.
JBSRouter default services do: [:ea | ea start].

Then point your jabber client at localhost:5222, tell it to create a new user 
for you, and you might find it works.  Or you might not... :)  Open a 
transcript: you'll see message being encoded and decoded.  I tested it tonight 
with Psi and was able to create two accounts, log in with both, add them to 
each others' rosters, and send messages back and forth.  Mileage may vary with 
other clients.  I can't remember if digest auth was working; you may need to 
tell your client to do plaintext authentication.  Not sure.

To try the client, I think you want to do:

JBCBuddyList open

but to be honest I never really looked in much detail at Michael's UI code.

Some general notes:
- I'm feeling pretty brave throwing this code out there without having even 
tried to figure out what state it was in over a year ago when I last touched 
it. Also, it being a mash of Michael's and my code, and since I just renamed 
and recategorized everything, there's bound to be breakage and obsolescence.
- When I was working on this before, I was trying to pull stuff out of the 
client to share with the server, but I hadn't yet got around to having the 
client use some of the new, extracted code.  The idea was to create 
JBPClientConnection that could be used both by the client, and by the client-
to-server module of the server to deal with the client protocol.
- Michael was writing the client code to be pluggable for different IM 
protocols.  For now, I've removed some of these (very abstract) classes as 
they didn't belong in this package and can be easily refactored out again 
should we ever have more than one IM protocol.
- Probably a whole bunch of other stuff but I'm tired and want to go to bed.

> (If anyone's interested in my code, I could publish it, but it's only 
> about half-finished, besides being generally pretty awful. It doesn't 
> even do messaging yet.)

Please do... or take a look at what I had and see if you can contribute to or 
steal from it.  I'd say my code would be lucky to be called half-finished but 
I was driving very hard to actually have it work with the basic client 
interaction.  That's the only reason I announced it last year: it seemed to do 
something.

Julian

-- 
julian at beta4.com
Beta4 Productions (http://www.beta4.com) 



More information about the Squeak-dev mailing list