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" }