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:
parent
14ca3e0668
commit
733ecd7d96
@ -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
|
||||
|
@ -86,13 +86,22 @@ public abstract class Conversation
|
||||
}
|
||||
|
||||
/**
|
||||
* Get channel history
|
||||
*
|
||||
* @return
|
||||
* Get size of the current history
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user