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,41 +70,16 @@ 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() {
|
||||
// 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)
|
||||
}
|
||||
|
||||
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 {
|
||||
switch action {
|
||||
case "post":
|
||||
|
@ -129,5 +104,5 @@ func (self *HonkAdapter) Do(action string, data map[string]string) error {
|
|||
}
|
||||
|
||||
func (self *HonkAdapter) DefaultSubscriptionFilter() string {
|
||||
return ""
|
||||
return "home"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue