forked from Mirrors/gomuks
Retrieve the most recent message accurately
This commit is contained in:
parent
43b939f567
commit
78cda42654
1 changed files with 4 additions and 4 deletions
|
@ -103,10 +103,10 @@ func (rstr *RosterView) getMostRecentMessage(room *rooms.Room) (string, bool) {
|
||||||
go rstr.parent.LoadHistory(room.ID)
|
go rstr.parent.LoadHistory(room.ID)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(roomView.content.msgBuffer) > 0 {
|
if len(roomView.content.messages) > 0 {
|
||||||
for _, msg := range roomView.content.msgBuffer {
|
for index := len(roomView.content.messages) - 1; index >= 0; index-- {
|
||||||
if msg.Type == event.MsgText {
|
if roomView.content.messages[index].Type == event.MsgText {
|
||||||
return msg.PlainText(), true
|
return roomView.content.messages[index].PlainText(), true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue