|
|
@@ -3,7 +3,6 @@ package foodgroup
|
|
|
import (
|
|
|
"context"
|
|
|
"crypto/md5"
|
|
|
- "errors"
|
|
|
"fmt"
|
|
|
"log/slog"
|
|
|
|
|
|
@@ -19,9 +18,6 @@ var blankGIF = []byte{
|
|
|
0x32, 0x00, 0x32, 0x00, 0x00, 0x02, 0x02, 0x44, 0x01, 0x00, 0x3b,
|
|
|
}
|
|
|
|
|
|
-// errKnownIconsOnly indicates that a non-known buddy icon was requested
|
|
|
-var errKnownIconsOnly = errors.New("can only satisfy requests for known icons")
|
|
|
-
|
|
|
func NewBARTService(logger *slog.Logger, bartManager BARTManager, messageRelayer MessageRelayer, feedbagManager FeedbagManager, legacyBuddyListManager LegacyBuddyListManager) BARTService {
|
|
|
return BARTService{
|
|
|
bartManager: bartManager,
|
|
|
@@ -72,11 +68,10 @@ func (s BARTService) UpsertItem(ctx context.Context, sess *state.Session, inFram
|
|
|
}, nil
|
|
|
}
|
|
|
|
|
|
+// RetrieveItem fetches a BART item from the data store. The item is selected
|
|
|
+// based on inBody.Hash. It's unclear what effect inBody.Flags is supposed to
|
|
|
+// have on the request.
|
|
|
func (s BARTService) RetrieveItem(ctx context.Context, sess *state.Session, inFrame wire.SNACFrame, inBody wire.SNAC_0x10_0x04_BARTDownloadQuery) (wire.SNACMessage, error) {
|
|
|
- if inBody.Flags != wire.BARTFlagsKnown {
|
|
|
- return wire.SNACMessage{}, errKnownIconsOnly
|
|
|
- }
|
|
|
-
|
|
|
var icon []byte
|
|
|
if inBody.HasClearIconHash() {
|
|
|
icon = blankGIF
|