diff --git a/src/org/yaaic/adapter/MessageListAdapter.java b/src/org/yaaic/adapter/MessageListAdapter.java index 6257f1c..f27855c 100644 --- a/src/org/yaaic/adapter/MessageListAdapter.java +++ b/src/org/yaaic/adapter/MessageListAdapter.java @@ -61,8 +61,8 @@ public class MessageListAdapter extends BaseAdapter messages.add(header.renderTextView(context)); } - for (Message message : conversation.getHistory()) { - messages.add(message.renderTextView(context)); + for (int i = 0; i < conversation.getHistorySize(); i++) { + messages.add(conversation.getHistoryMessage(i).renderTextView(context)); } // XXX: We don't want to clear the buffer, we want to add only diff --git a/src/org/yaaic/model/Conversation.java b/src/org/yaaic/model/Conversation.java index 33b6d97..b3cbe7e 100644 --- a/src/org/yaaic/model/Conversation.java +++ b/src/org/yaaic/model/Conversation.java @@ -86,13 +86,22 @@ public abstract class Conversation } /** - * Get channel history - * - * @return + * Get size of the current history */ - public List getHistory() + public int getHistorySize() { - return history; + return history.size(); + } + + /** + * Get message of the history at the given position + * + * @param position + * @return The message at the given position + */ + public Message getHistoryMessage(int position) + { + return history.get(position); } /**