friendica / dir

Friendica Global Directory

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support the "account-type"

annando opened this issue · comments

Since the last versions we can define an account type (Person, Organization, News, Community). It would be good if the directory could support this.

Is there any specific rules depending on the account type? Or is it just about displaying the type?

It would be good to have it as an addition to the current separation in "All", "People" and "Forums".

So there would be now: "All", "People", "Organizations", "News accounts" and "Forums".

Ok, this is exactly what I had in mind, thanks for the clarification.

Great! If you need some help in providing the data for the directory, then just tell me. I'm not sure how it is currently exposed. I know that it is transferred via DFRN and I have in mind that it is distributed via POCO as well.

I'm in the process of entirely rewriting the directory code as a personal exercise in Dependency Injection, so I will get the chance to look at the noscrape output from Friendica and store any field that wasn't handled before.

If there's no output of the account-type, then now is a good time to add it on the Friendica side.

Normally we should export it since several versions, but I don't know where.

There's only a community flag in the noscrape output whether the account is a personal account or a forum.

See https://friendica.mrpetovan.com/noscrape/hypolite

{
	"addr": "hypolite@friendica.mrpetovan.com",
	"nick": "hypolite",
	"guid": "735a20292057e0afa5e14c2885654633",
	"key": "-----BEGIN PUBLIC KEY-----\nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA4YyL4Z36Ir\/c93PyiEnu\nOHawWwt1ysqjCTNiLTvWWQq0VeobmQhpUDWW9W2cWJGwFLxEPt7EC7tHC0z\/5hup\nj0u\/XRE3bJAMK09WX+k4pwL9YHsznbbUkBglYvU7fcxtV3Jf6LqB7uifCkGt9zif\nIRzN4bDhxUnLVlwGbhLSgsZPYMyDgNmmNre3CoUtQPUnZBqn52igMjsekKceAgcQ\nWKLoTF9j+6ktr\/bhFHCAZYpsBCooIhxL9Q1OgQgMvGfyp+uHUXIMeewnRrG5asA+\nTCUab2gu8XTW16JgZQ6oxFxOkkMhxZ6A6MJWsEmvUOKZXyDalQ2lQA3V0De313XQ\nLvXM+z1gCzkXrQa76uJB0M+dHLSDJe80uLf+tuiJdvqijxFK8Da+WDNvoHezdjCA\nKLjuf4dc+VAxUPUtNBILTP4hIVECutyxiKZVGRwz2+8a4ZkFLMmRMKnxcBGfQWiu\nByPqsmjTvd77ZRPmyCld+S6PM040Eb0pkqnAPFF8TJvyfE\/PaqHMoVHs4kJUOnrH\n1JXBDQw67ogfs4Cu9Nvv732DtPwjV8tP11tPfgnrfJPue3AO8+X2OEYvPx\/Jit+4\n9Bl\/yKVFMXi0OFDejnQ3O7ymB1W1ZaQbOdgtm\/yPNm40PCPrmBpI12qbr8NMFM15\njP3rHRIG989q4PZFeF4Am0sCAwEAAQ==\n-----END PUBLIC KEY-----\n",
	"homepage": "https:\/\/friendica.mrpetovan.com\/profile\/hypolite",
	"comm": false,
	"fn": "Hyp\ud83c\udf27lite Pe\u2602ov\ud83c\udf43n (he\/him)",
	"photo": "https:\/\/friendica.mrpetovan.com\/photo\/27330388315ae4ed2b03e3c116980490-4.jpg?ts=1540951359",
	"tags": ["videogame", "gaming", "boardgame", "politics", "philosophy", "development", "programming", "php"],
	"updated": "2018-11-01T13:31:31-04:00",
	"contacts": 383,
	"last-activity": "2018-44",
	"pdesc": "Subpar geek, french\/english, science, games, feminism, jokes and anything in between. Avatar by @DearMsDear@mastodon.art",
	"locality": "Brooklyn",
	"region": "New York",
	"country-name": "USA",
	"gender": "Male",
	"marital": "Partners",
	"about": "Subpar geek, french\/english, science, games, feminism, jokes and anything in between. Avatar by @DearMsDear@mastodon.art",
	"dfrn-request": "https:\/\/friendica.mrpetovan.com\/dfrn_request\/hypolite",
	"dfrn-confirm": "https:\/\/friendica.mrpetovan.com\/dfrn_confirm\/hypolite",
	"dfrn-notify": "https:\/\/friendica.mrpetovan.com\/dfrn_notify\/hypolite",
	"dfrn-poll": "https:\/\/friendica.mrpetovan.com\/dfrn_poll\/hypolite"
}

No, we really should transmit the other type in some way.

Be my guest, I'm going to prepare a free-form text field for the account type in the new directory data structure. For now it's going to be either "People" or "Forum" but it will accept any new string seamlessly.

Some more strict field content would be better, since I guess it would be great to (e.g.) be able to search for news accounts,

AND `account_type` = "News"

The data structure is ready on the next version of the directory, we just need to agree on the noscrape output.