mirror of
git://git.psyced.org/git/psyced
synced 2024-08-15 03:25:10 +00:00
threads web interface improvements, accessible now at /~nick/channel & /@place
This commit is contained in:
parent
bc0b9dd325
commit
a5b52d8264
10 changed files with 372 additions and 343 deletions
|
@ -18,7 +18,7 @@ mapping request_params = ([ ]);
|
|||
mapping access_params = ([ ]);
|
||||
string access_token_url;
|
||||
string authorize_url;
|
||||
string callback_url = "http://" + my_lower_case_host() + ":" + HTTP_PORT + "/oauth"; //TODO: https?
|
||||
string callback_url = HTTPS_OR_HTTP_URL + "/oauth";
|
||||
object user;
|
||||
|
||||
varargs void fetch(object ua, string url, string method, mapping post, mapping oauth) {
|
||||
|
|
|
@ -191,15 +191,21 @@ case "/oauth":
|
|||
quit();
|
||||
return 1;
|
||||
}
|
||||
string name;
|
||||
switch (file[1]) {
|
||||
case '~':
|
||||
if (o = summon_person(file[2..], NET_PATH "user")) {
|
||||
o->htinfo(version, query, headers, qs);
|
||||
string channel, nick = file[2..];
|
||||
if (sscanf(file, "/~%s/%s", nick, channel)) {
|
||||
name = "~" + nick + "#" + channel;
|
||||
} else if (o = summon_person(nick, NET_PATH "user")) {
|
||||
o->htinfo(version, query, headers, qs, channel);
|
||||
quit();
|
||||
return 1;
|
||||
}
|
||||
quit();
|
||||
return 1;
|
||||
//fall thru
|
||||
case '@':
|
||||
file = PLACE_PATH+ lower_case(file[2..]);
|
||||
unless(name) name = file[2..];
|
||||
o = find_place(name);
|
||||
break;
|
||||
default:
|
||||
if (abbrev("/static/", file)) {
|
||||
|
@ -232,7 +238,7 @@ case "/oauth":
|
|||
return;
|
||||
}
|
||||
|
||||
o = file -> load();
|
||||
unless (o) o = file -> load();
|
||||
if (objectp(o) || o = find_object(file))
|
||||
done = o->htget(version, query, headers, qs) != HTMORE;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue