selectAccountDataByType return ClientEvent pointer instead of slice of ClientEvent (#798)

This pull request is an attempt to fix #773.

Signed-off-by: Kouame Behouba Manassé behouba@gmail.com
This commit is contained in:
Behouba Manassé 2019-09-30 19:25:04 +03:00 committed by Andrew Morgan
parent 7b454bdd27
commit 49fd47c863
4 changed files with 18 additions and 29 deletions

View file

@ -263,11 +263,11 @@ func (d *Database) GetAccountData(ctx context.Context, localpart string) (
// GetAccountDataByType returns account data matching a given
// localpart, room ID and type.
// If no account data could be found, returns an empty array
// If no account data could be found, returns nil
// Returns an error if there was an issue with the retrieval
func (d *Database) GetAccountDataByType(
ctx context.Context, localpart, roomID, dataType string,
) (data []gomatrixserverlib.ClientEvent, err error) {
) (data *gomatrixserverlib.ClientEvent, err error) {
return d.accountDatas.selectAccountDataByType(
ctx, localpart, roomID, dataType,
)