1
0
mirror of https://github.com/moparisthebest/Yaaic synced 2024-11-26 02:42:16 -05:00

Do not expose complete history list, make the history accessible via index - see issue 2

This commit is contained in:
Sebastian Kaspari 2010-03-11 23:46:11 +01:00
parent 14ca3e0668
commit 733ecd7d96
2 changed files with 16 additions and 7 deletions

View File

@ -61,8 +61,8 @@ public class MessageListAdapter extends BaseAdapter
messages.add(header.renderTextView(context)); messages.add(header.renderTextView(context));
} }
for (Message message : conversation.getHistory()) { for (int i = 0; i < conversation.getHistorySize(); i++) {
messages.add(message.renderTextView(context)); messages.add(conversation.getHistoryMessage(i).renderTextView(context));
} }
// XXX: We don't want to clear the buffer, we want to add only // XXX: We don't want to clear the buffer, we want to add only

View File

@ -86,13 +86,22 @@ public abstract class Conversation
} }
/** /**
* Get channel history * Get size of the current history
*
* @return
*/ */
public List<Message> 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);
} }
/** /**