From 305366dc9ed4cb3df859b0038bdb5757fd0365d7 Mon Sep 17 00:00:00 2001 From: Iris Lightshard Date: Sun, 1 Dec 2024 10:52:36 -0700 Subject: [PATCH] honk fetch just calls anonymous fetch cause the honk API is so tiny --- adapter/honk.go | 37 ++++++------------------------------- 1 file changed, 6 insertions(+), 31 deletions(-) diff --git a/adapter/honk.go b/adapter/honk.go index 2516ec7..6b9bc90 100644 --- a/adapter/honk.go +++ b/adapter/honk.go @@ -70,39 +70,14 @@ func (self *HonkAdapter) Init(settings Settings, data *chan SocketData) error { } func (self *HonkAdapter) Subscribe(string) []error { - return nil + // similar to the misskey adapter, we will poll for new honks and send them on the channel as they come in } func (self *HonkAdapter) Fetch(etype string, ids []string) error { - // if we're anonymous, we can fetch the data as raw AP - // KISS - if self.isAnonymous() { - aaa := anonAPAdapter{} - aaa.Init(self.data, self.server, "honk", self.nickname) - return aaa.Fetch(etype, ids) - } - - for _, _ = range ids { - switch etype { - case "byAuthor": - // gethonks - case "message": - // use honk-canonical XID - case "author": - if self.isAnonymous() { - // if we are using @user@server, translate it to https://server/u/user - } else { - // otherwise, use the URL as such - } - case "children": - // use honk-canonical XID - case "convoy": - if self.isAnonymous() { - } else { - } - } - } - return nil + // honk API is limited, we fall back to the anonymous adapter for fetch ops + aaa := anonAPAdapter{} + aaa.Init(self.data, self.server, "honk", self.nickname) + return aaa.Fetch(etype, ids) } func (self *HonkAdapter) Do(action string, data map[string]string) error { @@ -129,5 +104,5 @@ func (self *HonkAdapter) Do(action string, data map[string]string) error { } func (self *HonkAdapter) DefaultSubscriptionFilter() string { - return "" + return "home" }