I just looked at the conference.as example and noticed that it’'s not setting a roster, which is required (i think - need to check the spec). I added the following two lines after the var chatRoom = new Room(connection) statement, and removed the “chatRoster.dataProvider = chatRoom;” statement.
var myRoster:Roster = new Roster(connection);
myRoster.setPresence(null, “Online”, 5);
Also added the following imports:
import org.jivesoftware.xiff.im.Roster;
import org.jivesoftware.xiff.data.*;
And finally added the following line to put the user name into the chatRoster field in the Login event after the join statement:
chatRoster.addItem( connection.username );
Now if, I can only get it to actually respond to sending a message
I have an example in Flex that is based off this code, so I will attempt to get a flash example fully functional in the first 2.0 release. I’'m trying to automate the build and documentation generation at this point.
Thnx for your answer. I found antoher xmpp-example that is quite close to the answer you gave me. It’'s running beautifully. I can chat in a room with other flash and non-flash clients.
Now to figure out how to add custom data to a message like moods and maybe coordinates, I haven’‘t found any examples on how to use org.jivesoftware.xiff.data.Extension. If I figure it I’'ll be happy to make a sample application and release it here…
Hi gepatto, unfortunately there aren’'t really any examples or docs on the extension architecture yet.
The best thing to do right now is look at the existing extensions - the simplist one is probably the XHTMLExtension. Others are the whiteboarding extensions.
If you have questions I can explain more in detail here.
Hi Barry - Actually, the Room class has its own built-in roster, so you shouldn’'t need to use a separate Roster class. It uses the DataProvider API for interfacing.
Well, the ConferenceTest.as used to work perfect with jabberd 1.4.2, but I’'ll need to try with Jive.
The line
chatRoster.dataProvider = chatRoom;
that you removed sets the data provider of the data grid I use to display the room’'s roster - its what links the UI to the data. Perhaps the nomenclature I used was confusing.
I’'m guessing that once again this has to do with how Flex handles data providers, which is probably a different interface than the one that ships with Flash. Just like the other Roster problem.
Hmmm…i saw that and it didn’‘t work on my implementation of Jive Messenger 2.1.2. That’'s why I took it out and added the other roster code (which did work).
I was testing this in Flash and not Flex, but will try your ConferenceTest.as in Flex to see if it behaves the same.
Yes I was referring to the “yet another flash example”?
I am now working on merging the UI of ConferenceTest with the code of ‘‘yet another flash example’’.
I am gonna test the orginal ConferenceTest.as a little more, because it’'s strange that it does work on jabber1.4.2 and the windows version of jive2.1.2 but not the linux version.
at least here it doesn’‘t. I’'ll keep you updated…
Sean
I am thinking of putting together an example that doesn’‘t look a normal text-chat but more like the character chat’‘s you see everywhere, but I still want it to be compliant with ‘‘normal’’ jabber clients (they just won’‘t handle the extra data). I haven’‘t figured your whole XIFF class-structure out yet, but I’'ll have a look at the XHTML an whiteboard-Extension.