Package plugins.Freetalk

Examples of plugins.Freetalk.Message$Attachment


              // and you can link replies into multiple threads by replying to them with different thread URIs... so if there is only a parent URI and
              // no thread URI we cannot decide to which thread the message belongs because the parent might belong to multiple threads.
             
                // evaluate parentThread
                final String parentThreadID = params.get("ParentThreadID"); // may be null
                final Message parentThread;
                if(parentThreadID != null) {
                    try {
                        parentThread = mFreetalk.getMessageManager().get(parentThreadID);
                    } catch(final NoSuchMessageException e) {
                        throw new InvalidParameterException("Message specified by ParentThreadID was not found.");
                    }
                } else {
                  parentThread = null;
                }
               
                // evaluate parentMessage
                final String parentMsgId = params.get("ParentID"); // may be null
                final Message parentMessage;
                if (parentMsgId != null) {
                    try {
                        parentMessage = mFreetalk.getMessageManager().get(parentMsgId);
                    } catch(final NoSuchMessageException e) {
                        throw new InvalidParameterException("Message specified by ParentID was not found");
View Full Code Here


        }
        else if (desc.length() > 2 && desc.charAt(0) == '<' && desc.charAt(desc.length() - 1) == '>') {

          final String msgid = desc.substring(1, desc.length() - 1);
            try {
              final Message msg = mMessageManager.get(msgid);
              final ArrayList<FreetalkNNTPArticle> list = new ArrayList<FreetalkNNTPArticle>(2);
                list.add(new FreetalkNNTPArticle(msg));
                return list.iterator();
            }
            catch(NoSuchMessageException e) {
View Full Code Here

            }

            // TODO: Optimization: We don't need this lock probably, see Javadoc of postMessage
            synchronized(mMessageManager) {
                try {
                    Message parentMessage;
                    try {
                        parentMessage = mMessageManager.get(parser.getParentID());
                    }
                    catch (NoSuchFieldException e) {
                        parentMessage = null;
                    }
                    catch (NoSuchMessageException e) {
                        parentMessage = null;
                    }
                   
                  // FIXME: When replying to forked threads, this code will always sent the replies to the original thread. We need to find a way
                  // to figure out whether the user wanted to reply to a forked thread - does NNTP pass a thread ID?
                   
                    MessageURI parentMessageURI = null;
                    if (parentMessage != null) {
                        parentMessageURI = parentMessage.isThread() ? parentMessage.getURI() : parentMessage.getThreadURI();
                    }

                    final HashSet<String> boardSet = new HashSet<String>(parser.getBoards());
                    final OwnMessage message = mMessageManager.postMessage(parentMessageURI,
                        parentMessage, boardSet, parser.getReplyToBoard(), mAuthenticatedUser, parser.getTitle(), parser.getDate(), parser.getText(), null);
View Full Code Here

TOP

Related Classes of plugins.Freetalk.Message$Attachment

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.