Package net.rim.blackberry.api.bbm.platform.profile

Examples of net.rim.blackberry.api.bbm.platform.profile.BBMPlatformContact


    } // InviteContactsFunction
   
    private class AddFunction extends ScriptableFunctionBase {
        protected Object execute(Object thiz, Object[] args) throws Exception {
            final BBMPlatformUser user = (BBMPlatformUser) args[0];
            final BBMPlatformContact contact = (BBMPlatformContact) user.getPresence();
           
            // Cookie is optional
            final String cookie;
            if(args.length >= 2) {
                cookie = (String) args[1];
View Full Code Here


    private class RemoveFunction extends ScriptableFunctionBase {
        protected Object execute(Object thiz, Object[] args) throws Exception {
            Object arg0 = args[0];
            if(arg0 instanceof BBMPlatformUser) {
                BBMPlatformUser user = (BBMPlatformUser) arg0;
                BBMPlatformContact contact = (BBMPlatformContact) user.getPresence();
                _connection.remove(contact);
            } else if(arg0 instanceof Scriptable) {
                BBMPlatformUser[] usersArray = Util.scriptableUsersArrayToUserArray((Scriptable) arg0);
                BBMPlatformContactList contactList = Util.userArrayToContactList(usersArray);
                _connection.remove(contactList);
View Full Code Here

       
        // Create array of scriptable BBM platform user objects
        final BBMPlatformUser[] userArray = new BBMPlatformUser[contactList.size()];
        int i = 0;
        while(contactsEnum.hasMoreElements()) {
            BBMPlatformContact contact = (BBMPlatformContact) contactsEnum.nextElement();
            userArray[i++] = new BBMPlatformUser(contact);
        }
        return wrapUserArrayIn50(userArray);
    }
View Full Code Here

    }
   
    public static BBMPlatformContactList userArrayToContactList(BBMPlatformUser[] users) {
        final BBMPlatformContactList contactList = new BBMPlatformContactList();
        for(int i = 0; i < users.length; i++) {
            BBMPlatformContact contact = (BBMPlatformContact) users[i].getPresence();
            contactList.add(contact);
        }
        return contactList;
    }
View Full Code Here

     * @return the handle of a presence.
     */
    public static String getHandle(Presence presence) {
        final String handle;
        if(presence instanceof BBMPlatformContact) {
            final BBMPlatformContact contact = (BBMPlatformContact) presence;
            handle = contact.getHandle();
        } else if(presence instanceof UserProfile) {
            final UserProfile currentUser = (UserProfile) presence;
            handle = currentUser.getHandle();
        } else {
            handle = null;
View Full Code Here

     * @return the PPID of a presence.
     */
    public static String getPPID(Presence presence) {
        final String ppid;
        if(presence instanceof BBMPlatformContact) {
            final BBMPlatformContact contact = (BBMPlatformContact) presence;
            ppid = contact.getPPID();
        } else if(presence instanceof UserProfile) {
            final UserProfile currentUser = (UserProfile) presence;
            ppid = currentUser.getPPID();
        } else {
            ppid = null;
View Full Code Here

            if(args.length == 3) {
                msgServiceListener.setOnFileTransferFailed(onFailure);
                msgService.sendFile(fileURI, comment);
            } else if(args.length == 4) {
                BBMPlatformUser scriptContact = ((BBMPlatformUser) args[3]);
                BBMPlatformContact contact = (BBMPlatformContact) scriptContact.getPresence();
               
                msgServiceListener.setOnFileTransferFailed(onFailure);
                msgService.sendFile(contact, fileURI, comment);
            }
           
View Full Code Here

TOP

Related Classes of net.rim.blackberry.api.bbm.platform.profile.BBMPlatformContact

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.