Changeset 441 in code for trunk/downstream.go


Ignore:
Timestamp:
Jan 4, 2021, 4:17:35 PM (4 years ago)
Author:
contact
Message:

Make chat history operations optional in messageStore

Some stores may want not to implement chat history operations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/downstream.go

    r440 r441  
    17361736                }
    17371737
    1738                 if dc.user.msgStore == nil {
     1738                store, ok := dc.user.msgStore.(chatHistoryMessageStore)
     1739                if !ok {
    17391740                        return ircError{&irc.Message{
    17401741                                Command: irc.ERR_UNKNOWNCOMMAND,
     
    17761777                switch subcommand {
    17771778                case "BEFORE":
    1778                         history, err = dc.user.msgStore.LoadBeforeTime(uc.network, entity, timestamp, limit)
     1779                        history, err = store.LoadBeforeTime(uc.network, entity, timestamp, limit)
    17791780                case "AFTER":
    1780                         history, err = dc.user.msgStore.LoadAfterTime(uc.network, entity, timestamp, limit)
     1781                        history, err = store.LoadAfterTime(uc.network, entity, timestamp, limit)
    17811782                default:
    17821783                        // TODO: support LATEST, BETWEEN
Note: See TracChangeset for help on using the changeset viewer.