예제 #1
0
        /**
         * Establishes the login status of this session's Account.
         * @param loginStatus
         *  Reported login status of this session's Account.
         *
         * @see com.skype.tutorial.util.Listeners#onPropertyChange(com.skype.api.Account, com.skype.api.Account.Property, int, String)
         *
         * @since 1.0
         */
        public void setLoginStatus(Account.Status loginStatus)
        {
            this.loginStatus = loginStatus;

            MySession.myConsole.printf(myTutorialTag + ": " + "setting loginStatus to %s%n", loginStatus);
            return;
        }
예제 #2
0
        /**
         * AccountListener Override: Tutorial Handler - Account Properties.
         * <br /><br />
         * Status changes: Specifically looks for/handles login/logout status changes, and reports
         * those changes to the associated MySession instance. Writes notice of <em>all</em>
         * property changes to both the log and the console.
         * <br /><br />
         * Logout reasons: Writes reason for logout to both the log and the console. Useful for
         * differentiating explicit logout by user (Account.LogoutReason.LOGOUT_CALLED) and
         * forced logout by the SkypeKit runtime.
         * <br /><br />
         * Other property changes: Writes the name of the changed property to the console.
         *
         * @param affectedAccount
         *  Ignored - always assumes <em>our</em> account, so references effected through
         *  <code>mySession.myAccount</code>.
         * @param prop
         *  The Account property that triggered this event.
         * @param value
         *  Ignored.
         *
         * @since 1.0
         *
         * @see com.skype.api.AccountListener#onPropertyChange(com.skype.api.Account, com.skype.api.Account.Property, int, String)
         */
        public void onPropertyChange(com.skype.api.Account affectedAccount, com.skype.api.Account.Property prop, int value, String svalue)
        {
            MySession.myConsole.println(mySession.myTutorialTag + ": " + "onPropertyChange - Account");

            /*
             *      MySession.myConsole.printf("%s: value = %d; svalue = %s%n", mySession.myTutorialTag, value, svalue);
             */

            if (prop == Account.Property.P_STATUS)
            {
                Account.Status accountStatus = affectedAccount.getStatus();
                mySession.setLoginStatus(accountStatus);
                if (value == Account.Status.LOGGED_IN_VALUE)
                {
                    MySession.myConsole.println(mySession.myTutorialTag + ": " + "Login complete.");
                }
                else if ((accountStatus == Account.Status.LOGGED_OUT) ||
                         (accountStatus == Account.Status.LOGGED_OUT_AND_PWD_SAVED))
                {
                    MySession.myConsole.println(mySession.myTutorialTag + ": " + "Login in progress/Logout complete.");
                }
                else
                {
                    //String otherStatus = new String("Account Status = " + accountStatus);
                    //MySession.myConsole.printf("%s: %s%n", mySession.myTutorialTag, otherStatus);
                }
            }
            else if (prop == Account.Property.P_LOGOUT_REASON)
            {
                Account.LogoutReason logoutReason = affectedAccount.getLogoutReason();
                MySession.myConsole.printf("%s: logoutreason = %s%n",
                                           mySession.myTutorialTag, logoutReason);
            }
            else
            {
                //String propName = prop;
                //MySession.myConsole.printf("%s: %s property changed!%n",
                //                    mySession.myTutorialTag, propName);
            }
        }
예제 #3
0
        /**
         * Establishes the login status of this session's Account.
         * @param loginStatus
         * 	Reported login status of this session's Account.
         *
         * @see com.skype.tutorial.util.Listeners#onPropertyChange(com.skype.api.Account, com.skype.api.Account.Property, int, String)
         *
         * @since 1.0
         */
        public void setLoginStatus(Account.Status loginStatus)
        {
            this.loginStatus = loginStatus;

            MySession.myConsole.printf(myTutorialTag + ": " + "setting loginStatus to %s%n", loginStatus);
            return;
        }