Package net.sf.jml

Examples of net.sf.jml.MsnList


    public void addFriendToList(MsnList[] lists, MsnContactImpl contact)
    {
        for (int i = 0; i < lists.length; i++)
        {
            MsnList msnList = lists[i];
            contact.setInList(msnList, true);
        }

        AbstractMessenger messenger = (AbstractMessenger)session.getMessenger();
        OutgoingADL o1 = new OutgoingADL(messenger.getActualMsnProtocol());
View Full Code Here


  protected void messageReceived(MsnSession session) {
        super.messageReceived(session);

        MsnContactListImpl contactList = (MsnContactListImpl) session
                .getMessenger().getContactList();
        MsnList list = getList();

        //   Update contact list
        if (list == MsnList.RL) {
            MsnContactImpl contact = (MsnContactImpl) contactList
                    .getContactByEmail(getEmail());
View Full Code Here

        super.messageReceived(session);

        MsnContactListImpl contactList = (MsnContactListImpl) session
                .getMessenger().getContactList();
        Email email = getEmail();
        MsnList list = getList();

        //    Update contact list
        MsnContactImpl contact = (MsnContactImpl) contactList
                .getContactByEmail(email);
        if (contact == null) {
View Full Code Here

    public void addFriendToList(MsnList[] lists, MsnContactImpl contact)
    {
        for (int i = 0; i < lists.length; i++)
        {
            MsnList msnList = lists[i];
            contact.setInList(msnList, true);
        }

        AbstractMessenger messenger = (AbstractMessenger)session.getMessenger();
        OutgoingADL o1 = new OutgoingADL(messenger.getActualMsnProtocol());
View Full Code Here

            if (message.getTransactionId() == trId)
            {
                MsnContactImpl contact = ((OutgoingADL) message).getContact();
                if(contact != null)
                {
                    MsnList list = null;

                    if(contact.isInList(MsnList.FL))
                        list = MsnList.FL;
                    else if(contact.isInList(MsnList.AL))
                        list = MsnList.AL;

                    ((AbstractMessenger) session.getMessenger())
                        .fireContactAddCompleted(contact, list);

                    OutgoingFQY m = new OutgoingFQY(protocol);
                    m.setContact(contact);
                    session.getMessenger().send(m);

                    return;
                }
            }
        }


        byte[] chunk = getChunkData();
        if(chunk == null || chunk.length == 0)
            return;

        try
        {
            MsnContactListImpl contactList = (MsnContactListImpl) session
                .getMessenger().getContactList();

            DocumentBuilderFactory dbfactory = DocumentBuilderFactory.newInstance();
            dbfactory.setIgnoringComments(true);
            DocumentBuilder docBuilder = dbfactory.newDocumentBuilder();

            ByteArrayInputStream in = new ByteArrayInputStream(chunk);
            Document doc = docBuilder.parse(in);
            Element rootEl = doc.getDocumentElement();

            String domain =
                XmlUtils.findChild(rootEl, "d").getAttribute("n");

            String contactName =
                XmlUtils.findChildByChain(rootEl, new String[]{"d", "c"}).getAttribute("n");
            String type =
                XmlUtils.findChildByChain(rootEl, new String[]{"d", "c"}).getAttribute("t");

            String listStr =
                XmlUtils.findChildByChain(rootEl, new String[]{"d", "c"}).getAttribute("l");

            String name =
                XmlUtils.findChildByChain(rootEl, new String[]{"d", "c"}).getAttribute("f");

            MsnContactImpl contact = (MsnContactImpl) contactList
                .getContactByEmail(Email.parseStr(contactName + "@" + domain));

            if (contact == null)
            {
                contact = new MsnContactImpl(contactList);
                contact.setEmail(Email.parseStr(contactName + "@" + domain));
                contact.setFriendlyName(name);
                contact.setDisplayName(name);

                contactList.addContact(contact);
            }

            boolean isInRList = contact.isInList(MsnList.RL);
            int listNumber = Integer.parseInt(listStr);

            if(!(!isInRList && ((listNumber & MsnList.RL.getListId()) == MsnList.RL.getListId())))
                return;

            // when we are added from other user we receive ADL for
            // the event and must add him to the Reverse List
            // its server initiated transaction so its 0
            if(trId == 0 && listNumber == MsnList.RL.getListId())
            {
                contact.setInList(MsnList.RL, true);

                ((AbstractMessenger) session.getMessenger())
                    .fireContactAddedMe(contact);
            }
            else
            {
                MsnList lists[] = new MsnList[]{
                    MsnList.AL, MsnList.BL, MsnList.FL, MsnList.PL, MsnList.RL};

                for (int i = 0; i < lists.length; i++)
                {
                    MsnList list = lists[i];
                    if((listNumber & list.getListId()) == list.getListId())
                        contact.setInList(list, true);
                    else
                        contact.setInList(list, false);
                }
View Full Code Here

    public MsnList getList() {
        return MsnList.parseStr(getParam(0));
    }

    private int getSyntaxType() {
        MsnList list = getList();
        if (list == MsnList.RL)
            return 4;
        if (list == MsnList.FL) {
            if (getParamCount() == 4)
                return 2;
View Full Code Here

  protected void messageReceived(MsnSession session) {
        super.messageReceived(session);

        MsnContactListImpl contactList = (MsnContactListImpl) session
                .getMessenger().getContactList();
        MsnList list = getList();
        MsnContactImpl contact;

        int syntaxType = getSyntaxType();
        switch (syntaxType) {
        case 1:
View Full Code Here

            MsnOutgoingMessage message = (MsnOutgoingMessage) iterator.previous();
            if (message.getTransactionId() == trId)
            {
                MsnContactImpl contact = (MsnContactImpl)((OutgoingRML) message).getContact();

                MsnList list = ((OutgoingRML) message).getList();

                contact.setInList(list, false);
                if (contact.getListNumber() == 0)
                { //Not in any group, delete from contact list
                    contactList.removeContactByEmail(contact.getEmail());
View Full Code Here

TOP

Related Classes of net.sf.jml.MsnList

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.