SPARK-891: Typing notifications would be easier to see if also displayed near typing area

-Implement XEP-0085
1)Provide event handling for following chat states according with document:
-paused (user stopped typing message)
-composing (user started typing message)
-active(chat window gained focus)
-inactive (after 2 minutes of inactivity or chat focus lost)
-gone (after 10 minutes of inactivity)
2)Added text on chat window to display current chat state
3)Accomodate XEP-0022 (obsolete) impplementation into XEP-0085

-fixed chatTextInput focus event handling

git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@12897 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
mirceac
2011-11-24 15:20:09 +00:00
parent 3cf8e92cea
commit 031acae96f
7 changed files with 242 additions and 61 deletions

View File

@ -92,6 +92,7 @@ import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smack.packet.XMPPError;
import org.jivesoftware.smack.util.StringUtils;
import org.jivesoftware.smackx.ChatStateManager;
import org.jivesoftware.spark.SessionManager;
import org.jivesoftware.spark.SparkManager;
import org.jivesoftware.spark.Workspace;
@ -1103,6 +1104,8 @@ public class LoginDialog {
// Since the connection and workgroup are valid. Add a ConnectionListener
connection.addConnectionListener(SparkManager.getSessionManager());
//Initialize chat state notification mechanism in smack
ChatStateManager.getInstance(SparkManager.getConnection());
// Persist information
localPref.setLastUsername(getLoginUsername());