honk fetch just calls anonymous fetch cause the honk API is so tiny
This commit is contained in:
parent
a2017e3de8
commit
305366dc9e
1 changed files with 6 additions and 31 deletions
|
@ -70,39 +70,14 @@ func (self *HonkAdapter) Init(settings Settings, data *chan SocketData) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self *HonkAdapter) Subscribe(string) []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 {
|
func (self *HonkAdapter) Fetch(etype string, ids []string) error {
|
||||||
// if we're anonymous, we can fetch the data as raw AP
|
// honk API is limited, we fall back to the anonymous adapter for fetch ops
|
||||||
// KISS
|
aaa := anonAPAdapter{}
|
||||||
if self.isAnonymous() {
|
aaa.Init(self.data, self.server, "honk", self.nickname)
|
||||||
aaa := anonAPAdapter{}
|
return aaa.Fetch(etype, ids)
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self *HonkAdapter) Do(action string, data map[string]string) error {
|
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 {
|
func (self *HonkAdapter) DefaultSubscriptionFilter() string {
|
||||||
return ""
|
return "home"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue