1
0
Fork 0
mirror of git://git.psyced.org/git/psyced synced 2024-08-15 03:25:10 +00:00

_flag_enable_module_microblogging

This commit is contained in:
psyc://psyced.org/~lynX 2010-02-21 09:36:11 +01:00
parent 249ecc4237
commit f67c55a2e8
7 changed files with 34 additions and 14 deletions

View file

@ -3988,4 +3988,13 @@ user
=== 201001 ============================================================ === 201001 ============================================================
jabber/active jabber/active
+ handle dialback timeouts, thx fip + handle dialback timeouts, thx fip
smtp/outgoing, smtp/user
+ implementation of outgoing mail queue
=== 201002 ============================================================
person, user
+ allow multiple psyc clients per user, thx tg
usercmd
+ /forceenter only exists temporarily to circumvent a bug
userthreads, threads, accept etc
+ experimental microblogging on your web profile, thx tg
#define _flag_enable_module_microblogging

View file

@ -391,6 +391,7 @@ object compile_object(string file) {
unless (name = SIMUL_EFUN_FILE->legal_name(name, 1)) unless (name = SIMUL_EFUN_FILE->legal_name(name, 1))
return (object)0; return (object)0;
#ifdef _flag_enable_module_microblogging
string username; string username;
if (sscanf(file, "place/~%s#updates", username)) { if (sscanf(file, "place/~%s#updates", username)) {
object p; object p;
@ -408,6 +409,7 @@ object compile_object(string file) {
return (object)0; return (object)0;
} }
} }
#endif
#ifdef SANDBOX #ifdef SANDBOX
if (file_size(t = USER_PATH + name + ".c") != -1) { if (file_size(t = USER_PATH + name + ".c") != -1) {

View file

@ -146,13 +146,13 @@ sendmsg(target, mc, data, vars, source, showingLog, callback) {
// maybe we should keep the _identification of the target somewhere // maybe we should keep the _identification of the target somewhere
// in vars. but where? _target_identification ? and who needs that? // in vars. but where? _target_identification ? and who needs that?
// //
// we have _target_localtion and _target_identification here. but
// since its not implemented anywhere we are happy with this very
// comment. TODO
//
// great, if I ping xmpp:fippo@amessage.de this makes // great, if I ping xmpp:fippo@amessage.de this makes
// is xmpp:fippo@amessage.de/foo, but I DONT WANT THAT! // it xmpp:fippo@amessage.de/foo, but I DONT WANT THAT!
if (!objectp(target) || (objectp(target) && target->vQuery("scheme") != "psyc")) # ifdef ALPHA
// why do we if this?
if (!objectp(target) || (objectp(target)
&& target->vQuery("scheme") != "psyc"))
# endif
target = t; target = t;
} }
#endif //}}} #endif //}}}

View file

@ -2,7 +2,7 @@
#include <net.h> #include <net.h>
// legal nickname/placename test.. // legal nickname/placename test..
varargs string legal_name(string name, int place) { varargs string legal_name(string name, int isPlace) {
int i; int i;
string n = name; string n = name;
@ -27,10 +27,11 @@ varargs string legal_name(string name, int place) {
return 0; return 0;
} }
#ifdef _flag_enable_module_microblogging
string nick; string nick;
if (place && sscanf(name, "~%s#updates", nick)) if (isPlace && sscanf(name, "~%s#updates", nick))
n = nick; n = nick;
#endif
string chars = "\ string chars = "\
abcdefghijklmnopqrstuvwxyz\ abcdefghijklmnopqrstuvwxyz\
ABCDEFGHIJKLMNOPQRSTUVWXYZ\ ABCDEFGHIJKLMNOPQRSTUVWXYZ\
@ -43,7 +44,7 @@ ABCDEFGHIJKLMNOPQRSTUVWXYZ\
return 0; return 0;
} }
} }
return name; return name; // we used to return n here instead..
} }
array(string) legal_password(string pw, string nick) { array(string) legal_password(string pw, string nick) {

View file

@ -134,6 +134,7 @@ object find_psyc_object(array(mixed) u) {
case '^': case '^':
break; break;
case '~': case '~':
#ifdef _flag_enable_module_microblogging
if (u[UChannel]) { if (u[UChannel]) {
t = lower_case(r + "#" + u[UChannel]); t = lower_case(r + "#" + u[UChannel]);
r = PLACE_PATH + t; r = PLACE_PATH + t;
@ -141,6 +142,7 @@ object find_psyc_object(array(mixed) u) {
unless (t = legal_name(t)) break; unless (t = legal_name(t)) break;
catch(o = r -> load(t)); catch(o = r -> load(t));
} }
#endif
break; break;
case '$': case '$':
// target wird auf serv/args gesetzt // target wird auf serv/args gesetzt

View file

@ -284,9 +284,10 @@ htDescription(anonymous, query, headers, qs, variant, vars) {
// <input type=hidden name=lang value=\""+v("language")+"\">\n\ // <input type=hidden name=lang value=\""+v("language")+"\">\n\
// //
# ifdef _flag_enable_module_microblogging
object u = find_place("~" + nick + "#updates"); object u = find_place("~" + nick + "#updates");
string updates = objectp(u) ? u->htMain(10) : ""; string updates = objectp(u) ? u->htMain(10) : "";
# endif
return psyctext(page, vars + ([ return psyctext(page, vars + ([
"_FORM_start" : "\ "_FORM_start" : "\
<form class=\"Pef\" name=\"Pef\" action=\"\">\n\ <form class=\"Pef\" name=\"Pef\" action=\"\">\n\
@ -296,7 +297,10 @@ htDescription(anonymous, query, headers, qs, variant, vars) {
"_nick_me" : MYNICK, "_nick_me" : MYNICK,
"_FORM_end" : "</form>\n", "_FORM_end" : "</form>\n",
]) ])
) + updates; )
# ifdef _flag_enable_module_microblogging
+ updates
# endif
; ;
} }
#endif #endif

View file

@ -908,6 +908,7 @@ cmd(a, args, dest, command) {
else else
teleport(args[1], "_join", 0, 1); teleport(args[1], "_join", 0, 1);
break; break;
#ifdef DEVELOPMENT
case "forceenter": case "forceenter":
case "forcejoin": case "forcejoin":
if (sizeof(args) < 2) { if (sizeof(args) < 2) {
@ -936,6 +937,7 @@ cmd(a, args, dest, command) {
break; break;
// etwas hässlich so.. aber was will man sonst? beim zweiten versuch? // etwas hässlich so.. aber was will man sonst? beim zweiten versuch?
// oder gar als flag von /leave? // oder gar als flag von /leave?
#endif
case "forceleave": // delete the membership from places mapping case "forceleave": // delete the membership from places mapping
if (member(places, (t = sizeof(args) < 2 ? place : args[1]))) { if (member(places, (t = sizeof(args) < 2 ? place : args[1]))) {
m_delete(places, t); m_delete(places, t);