1
0
Fork 0
forked from Mirrors/gomuks

hicli/json-commands: disable get_events_by_rowids

This commit is contained in:
Tulir Asokan 2024-12-18 00:48:10 +02:00
parent aa8148f5af
commit 158409db2f
2 changed files with 9 additions and 9 deletions

View file

@ -106,10 +106,10 @@ func (h *HiClient) handleJSONCommand(ctx context.Context, req *JSONCommand) (any
return unmarshalAndCall(req.Data, func(params *getEventParams) (*database.Event, error) { return unmarshalAndCall(req.Data, func(params *getEventParams) (*database.Event, error) {
return h.GetEvent(ctx, params.RoomID, params.EventID) return h.GetEvent(ctx, params.RoomID, params.EventID)
}) })
case "get_events_by_rowids": //case "get_events_by_rowids":
return unmarshalAndCall(req.Data, func(params *getEventsByRowIDsParams) ([]*database.Event, error) { // return unmarshalAndCall(req.Data, func(params *getEventsByRowIDsParams) ([]*database.Event, error) {
return h.GetEventsByRowIDs(ctx, params.RowIDs) // return h.GetEventsByRowIDs(ctx, params.RowIDs)
}) // })
case "get_room_state": case "get_room_state":
return unmarshalAndCall(req.Data, func(params *getRoomStateParams) ([]*database.Event, error) { return unmarshalAndCall(req.Data, func(params *getRoomStateParams) ([]*database.Event, error) {
return h.GetRoomState(ctx, params.RoomID, params.IncludeMembers, params.FetchMembers, params.Refetch) return h.GetRoomState(ctx, params.RoomID, params.IncludeMembers, params.FetchMembers, params.Refetch)
@ -259,9 +259,9 @@ type getEventParams struct {
EventID id.EventID `json:"event_id"` EventID id.EventID `json:"event_id"`
} }
type getEventsByRowIDsParams struct { //type getEventsByRowIDsParams struct {
RowIDs []database.EventRowID `json:"row_ids"` // RowIDs []database.EventRowID `json:"row_ids"`
} //}
type getRoomStateParams struct { type getRoomStateParams struct {
RoomID id.RoomID `json:"room_id"` RoomID id.RoomID `json:"room_id"`

View file

@ -22,7 +22,7 @@ import (
var ErrPaginationAlreadyInProgress = errors.New("pagination is already in progress") var ErrPaginationAlreadyInProgress = errors.New("pagination is already in progress")
func (h *HiClient) GetEventsByRowIDs(ctx context.Context, rowIDs []database.EventRowID) ([]*database.Event, error) { /*func (h *HiClient) GetEventsByRowIDs(ctx context.Context, rowIDs []database.EventRowID) ([]*database.Event, error) {
events, err := h.DB.Event.GetByRowIDs(ctx, rowIDs...) events, err := h.DB.Event.GetByRowIDs(ctx, rowIDs...)
if err != nil { if err != nil {
return nil, err return nil, err
@ -51,7 +51,7 @@ func (h *HiClient) GetEventsByRowIDs(ctx context.Context, rowIDs []database.Even
// TODO slow path where events are collected and filling is done one room at a time? // TODO slow path where events are collected and filling is done one room at a time?
} }
return events, nil return events, nil
} }*/
func (h *HiClient) GetEvent(ctx context.Context, roomID id.RoomID, eventID id.EventID) (*database.Event, error) { func (h *HiClient) GetEvent(ctx context.Context, roomID id.RoomID, eventID id.EventID) (*database.Event, error) {
if evt, err := h.DB.Event.GetByID(ctx, eventID); err != nil { if evt, err := h.DB.Event.GetByID(ctx, eventID); err != nil {