powered by Jive Software

Corrections for HTML docs

The HTML docs that come with Smack 3.0.2 have errors. I haven’'t finished reading through every page but here are the corrections for first 6 pages listed in the toc.

smack3_0_2/documentation/gettingstarted.html_

Presence presence = new Presence(Presence.Type.UNAVAILABLE);

Change to:

Presence presence = new Presence(Presence.Type.unavailable);

smack3_0_2/documentation/messaging.html_

// Assume we’'ve created an XMPPConnection name “connection”.

ChatManager chatmanager = connection.getChatManager();

Chat newChat = chatmanager.createChat("jsmith@jivesoftware.com", new MessageListener() {

public void processMessage(Chat chat, Message message) {

System.out.println("Received message: " + message);

}

});

try {

chat.sendMessage(“Howdy!”);

} catch (XMPPException e) {

System.out.println(“Error Delivering block”);

}

Should be:

// Assume we’'ve created an XMPPConnection name “connection”.

ChatManager chatmanager = connection.getChatManager();

Chat newChat = chatmanager.createChat("jsmith@jivesoftware.com", new MessageListener() {

public void processMessage(Chat chat, Message message) {

System.out.println("Received message: " + message);

}

});

try {

newChat.sendMessage(“Howdy!”);

} catch (XMPPException e) {

System.out.println(“Error Delivering block”);

}

And:

Message newMessage = newChat.createMessage();

newMessage.setBody(“Howdy!”);

message.setProperty(“favoriteColor”, “red”);

newChat.sendMessage(newMessage);

Should be:

Message newMessage = new Message();

newMessage.setBody(“Howdy!”);

newMessage.setProperty(“favoriteColor”, “red”);

newChat.sendMessage(newMessage);

smack3_0_2/documentation/roster.html_

Roster roster = con.getRoster();

for (Iterator i=roster.getEntries(); i.hasNext(); ) {

System.out.println(i.next());

}

Should be:

Roster roster = connection.getRoster();

Collection<RosterEntry> entries = roster.getEntries();

for (RosterEntry entry : entries) {

System.out.println(entry);

}

And:

final Roster roster = con.getRoster();

roster.addRosterListener(new RosterListener() {

public void rosterModified() {

// Ignore event for this example.

}

public void presenceChanged(String user) {

// If the presence is unavailable then “null” will be printed,

// which is fine for this example.

System.out.println("Presence changed: " + roster.getPresence(user));

}

});

Should be:

Roster roster = con.getRoster();

roster.addRosterListener(new RosterListener() {

// Ignored events

public void entriesAdded(Collection<String> addresses) {}

public void entriesDeleted(Collection<String> addresses) {}

public void entriesUpdated(Collection<String> addresses) {}

public void presenceChanged(Presence presence) {

System.out.println("Presence changed: " + presence.getFrom() + " " + presence);

}

});

And:

Roster.setSubscriptionMode(int subscriptionMode)

Should be:

Roster.setSubscriptionMode(Roster.SubscriptionMode)

And:

Presence.Type.SUBSCRIBE

Should be:

Presence.Type.subscribe

So I was kind of hoping for a reply…do the smack developers read this forum or is there a better way to contact them?

Sorry for the delay! I filed this as SMACK-227 and checked in fixes for the next release.

Regards,

Matt