diff --git a/src/org/yaaic/adapter/MessageListAdapter.java b/src/org/yaaic/adapter/MessageListAdapter.java index 050b2e7..d6907e7 100644 --- a/src/org/yaaic/adapter/MessageListAdapter.java +++ b/src/org/yaaic/adapter/MessageListAdapter.java @@ -90,6 +90,28 @@ public class MessageListAdapter extends BaseAdapter notifyDataSetChanged(); } + /** + * Add a list of messages to the list + * + * @param messages + */ + public void addBulkMessages(LinkedList messages) + { + LinkedList mMessages = this.messages; + Context mContext = this.context; + int mSize = messages.size(); + + for (int i = 0; i < mSize; i++) { + mMessages.add(messages.get(i).renderTextView(mContext)); + + if (mMessages.size() > Conversation.HISTORY_SIZE) { + mMessages.remove(0); + } + } + + notifyDataSetChanged(); + } + /** * Get number of items *