mirror of
https://github.com/ChronosX88/psyced.git
synced 2024-12-04 16:12:20 +00:00
january 2009
This commit is contained in:
parent
94530cc322
commit
bdfae4e350
1
.gitignore
vendored
1
.gitignore
vendored
@ -15,3 +15,4 @@ CVS
|
||||
*bak
|
||||
*diff
|
||||
*orig
|
||||
world/net/place/_*.c
|
||||
|
@ -1,4 +1,4 @@
|
||||
$Id: CHANGESTODO,v 1.1649 2008/11/29 12:38:48 lynx Exp $ vim:nosmarttab
|
||||
$Id: CHANGESTODO,v 1.1650 2008/12/30 12:35:00 lynx Exp $ vim:nosmarttab
|
||||
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
This file contains TODO and CHANGES (at EOF) rolled into one.
|
||||
Essentially: whenever you fix something, move that line to the end of file.
|
||||
@ -12,6 +12,7 @@ ________________________________________________________________________
|
||||
- remote IRC place does not send names listing on /join
|
||||
- remote IRC /part shows no reaction at first attempt
|
||||
+++ not limited to IRC!! thx marenz
|
||||
- /set multiplace should be ignored for rich accesses
|
||||
|
||||
- XMPP: first reply to a stranger's remote psyc message did not show up in psi
|
||||
|
||||
|
0
bin/psyked
Normal file → Executable file
0
bin/psyked
Normal file → Executable file
0
config/psyced.settings
Normal file → Executable file
0
config/psyced.settings
Normal file → Executable file
0
place/africa.c
Normal file → Executable file
0
place/africa.c
Normal file → Executable file
0
place/america.c
Normal file → Executable file
0
place/america.c
Normal file → Executable file
0
place/asia.c
Normal file → Executable file
0
place/asia.c
Normal file → Executable file
0
place/australia.c
Normal file → Executable file
0
place/australia.c
Normal file → Executable file
0
place/europa.c
Normal file → Executable file
0
place/europa.c
Normal file → Executable file
0
place/indigestion.c
Normal file → Executable file
0
place/indigestion.c
Normal file → Executable file
@ -1,18 +0,0 @@
|
||||
#include <net.h>
|
||||
#define NAME "IRC"
|
||||
|
||||
// gateway to ircnet
|
||||
//
|
||||
// just put this file into init.ls if you want it to
|
||||
// activate at boot time. addressing irc:nickname
|
||||
// should work also when this isn't loaded however.
|
||||
//
|
||||
#ifdef fly
|
||||
|
||||
# define CONNECT_IRC "irc.freenet.de" // an ircnet server
|
||||
|
||||
#else
|
||||
# define CONNECT "beta.ve.symlynX.com"
|
||||
#endif
|
||||
|
||||
#include <place.gen>
|
0
place/london.c
Normal file → Executable file
0
place/london.c
Normal file → Executable file
0
place/newyork.c
Normal file → Executable file
0
place/newyork.c
Normal file → Executable file
0
place/paris.c
Normal file → Executable file
0
place/paris.c
Normal file → Executable file
@ -1,4 +1,3 @@
|
||||
#if 0
|
||||
#include <net.h>
|
||||
#define SILENCE
|
||||
#define NAME "Spiegel-EN"
|
||||
@ -11,6 +10,5 @@
|
||||
#else
|
||||
# define CONNECT_DEFAULT
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <place.gen>
|
||||
|
@ -1,4 +1,3 @@
|
||||
#if 0
|
||||
#include <net.h>
|
||||
#define SILENCE
|
||||
#define NAME "Spiegel"
|
||||
@ -9,6 +8,5 @@
|
||||
#else
|
||||
# define CONNECT_DEFAULT
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <place.gen>
|
||||
|
0
place/telex.c
Normal file → Executable file
0
place/telex.c
Normal file → Executable file
0
place/tokyo.c
Normal file → Executable file
0
place/tokyo.c
Normal file → Executable file
0
run/md5.pl
Normal file → Executable file
0
run/md5.pl
Normal file → Executable file
0
run/sha1.pl
Normal file → Executable file
0
run/sha1.pl
Normal file → Executable file
0
utility/multipatcher
Normal file → Executable file
0
utility/multipatcher
Normal file → Executable file
@ -1720,7 +1720,7 @@ _warning_usage_notify
|
||||
|Syntax: /notify <nickname> [ i(mmediate),d(elayed),D(elayedMore) ]
|
||||
|
||||
_warning_usage_acquaintance
|
||||
|Syntax: /ignore oder /show <person>
|
||||
|Syntax: /ignore oder /display <person>
|
||||
|
||||
_warning_usage_mandate
|
||||
|Syntax: /mand(ate) «Scherge»
|
||||
@ -1747,6 +1747,18 @@ _warning_usage_my
|
||||
_warning_usage_unalias
|
||||
|Syntax: /unalias <Aliasname>
|
||||
|
||||
_warning_usage_kill
|
||||
|Syntax: /kill <Person> [<Nachricht>]
|
||||
|
||||
_warning_usage_warn
|
||||
|Syntax: /warn <Person> [<Nachricht>]
|
||||
|
||||
_echo_kill
|
||||
|[_entity] gekillt.
|
||||
|
||||
_echo_warn
|
||||
|[_entity] verwarnt.
|
||||
|
||||
_warning_usage_invite
|
||||
|Syntax: /invite <Person>
|
||||
|
||||
|
@ -1 +0,0 @@
|
||||
../local
|
@ -1,11 +0,0 @@
|
||||
#include <net.h>
|
||||
#include <text.h>
|
||||
#include <ht/http.h>
|
||||
|
||||
// phone call thing. we need to pass the query data to a flash film
|
||||
// but we don't have any flash film yet. TODO
|
||||
//
|
||||
htget(prot, query, headers, qs) {
|
||||
htredirect(prot, "/static/myVideo.swf", "stupid flash film", 0);
|
||||
return 1;
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
// generated by '/home/lynx/bin/psyconf': place.i for place.gen
|
||||
// generated by '/ve/dist/../bin/psyconf': place.i for place.gen
|
||||
|
||||
#ifdef PLACE_HISTORY
|
||||
# define Oh "h"
|
||||
|
@ -1,116 +0,0 @@
|
||||
<hbox><label value='askaction'/><textbox id='_action_ask' preference='profile_askaction'/></hbox>
|
||||
<hbox><label value='mottoaction'/><textbox id='_action_motto' preference='profile_mottoaction'/></hbox>
|
||||
<hbox><label value='speakaction'/><textbox id='_action_speak' preference='profile_speakaction'/></hbox>
|
||||
<hbox><label value='area'/><textbox id='_address_area' preference='profile_area'/></hbox>
|
||||
<hbox><label value='postalbox'/><textbox id='_address_box_postal' preference='profile_postalbox'/></hbox>
|
||||
<hbox><label value='building'/><textbox id='_address_building' preference='profile_building'/></hbox>
|
||||
<hbox><label value='postalcode'/><textbox id='_address_code_postal' preference='profile_postalcode'/></hbox>
|
||||
<hbox><label value='country'/><textbox id='_address_country' preference='profile_country'/></hbox>
|
||||
<hbox><label value='floor'/><textbox id='_address_floor' preference='profile_floor'/></hbox>
|
||||
<hbox><label value='latitude'/><textbox id='_address_latitude' preference='profile_latitude'/></hbox>
|
||||
<hbox><label value='locality'/><textbox id='_address_locality' preference='profile_locality'/></hbox>
|
||||
<hbox><label value='longitude'/><textbox id='_address_longitude' preference='profile_longitude'/></hbox>
|
||||
<hbox><label value='past'/><textbox id='_address_past' preference='profile_past'/></hbox>
|
||||
<hbox><label value='region'/><textbox id='_address_region' preference='profile_region'/></hbox>
|
||||
<hbox><label value='room'/><textbox id='_address_room' preference='profile_room'/></hbox>
|
||||
<hbox><label value='street'/><textbox id='_address_street' preference='profile_street'/></hbox>
|
||||
<hbox><label value='timezone'/><textbox id='_address_zone_time' preference='profile_timezone'/></hbox>
|
||||
<hbox><label value='affiliation'/><textbox id='_affiliation' preference='profile_affiliation'/></hbox>
|
||||
<hbox><label value='actioncharacter'/><textbox id='_character_action' preference='profile_actioncharacter'/></hbox>
|
||||
<hbox><label value='commandcharacter'/><textbox id='_character_command' preference='profile_commandcharacter'/></hbox>
|
||||
<hbox><label value='color'/><textbox id='_color' preference='profile_color'/></hbox>
|
||||
<hbox><label value='phone'/><textbox id='_contact_telephone' preference='profile_phone'/></hbox>
|
||||
<hbox><label value='fax'/><textbox id='_contact_telephone_fax' preference='profile_fax'/></hbox>
|
||||
<hbox><label value='pager'/><textbox id='_contact_telephone_pager' preference='profile_pager'/></hbox>
|
||||
<hbox><label value='homephone'/><textbox id='_contact_telephone_voice_home' preference='profile_homephone'/></hbox>
|
||||
<hbox><label value='mobilephone'/><textbox id='_contact_telephone_voice_mobile' preference='profile_mobilephone'/></hbox>
|
||||
<hbox><label value='workphone'/><textbox id='_contact_telephone_voice_work' preference='profile_workphone'/></hbox>
|
||||
<hbox><label value='birthday'/><textbox id='_date_birth' preference='profile_birthday'/></hbox>
|
||||
<hbox><label value='nameday'/><textbox id='_date_name' preference='profile_nameday'/></hbox>
|
||||
<hbox><label value='weddingday'/><textbox id='_date_wedding' preference='profile_weddingday'/></hbox>
|
||||
<hbox><label value='expertisetext'/><textbox id='_description_expertise' preference='profile_expertisetext'/></hbox>
|
||||
<hbox><label value='hobbytext'/><textbox id='_description_hobby' preference='profile_hobbytext'/></hbox>
|
||||
<hbox><label value='likestext'/><textbox id='_description_preferences' preference='profile_likestext'/></hbox>
|
||||
<hbox><label value='dislikestext'/><textbox id='_description_preferences_not' preference='profile_dislikestext'/></hbox>
|
||||
<hbox><label value='presencetext'/><textbox id='_description_presence' preference='profile_presencetext'/></hbox>
|
||||
<hbox><label value='privatetext'/><textbox id='_description_private' preference='profile_privatetext'/></hbox>
|
||||
<hbox><label value='publictext'/><textbox id='_description_public' preference='profile_publictext'/></hbox>
|
||||
<hbox><label value='quotestext'/><textbox id='_description_quotes' preference='profile_quotestext'/></hbox>
|
||||
<hbox><label value='charset'/><textbox id='_encoding_characters' preference='profile_charset'/></hbox>
|
||||
<hbox><label value='animalfave'/><textbox id='_favorite_animal' preference='profile_animalfave'/></hbox>
|
||||
<hbox><label value='athletesfave'/><textbox id='_favorite_athletes' preference='profile_athletesfave'/></hbox>
|
||||
<hbox><label value='drinksfave'/><textbox id='_favorite_drinks' preference='profile_drinksfave'/></hbox>
|
||||
<hbox><label value='foodsfave'/><textbox id='_favorite_foods' preference='profile_foodsfave'/></hbox>
|
||||
<hbox><label value='gamesfave'/><textbox id='_favorite_games' preference='profile_gamesfave'/></hbox>
|
||||
<hbox><label value='literaturefave'/><textbox id='_favorite_literature' preference='profile_literaturefave'/></hbox>
|
||||
<hbox><label value='moviesfave'/><textbox id='_favorite_movies' preference='profile_moviesfave'/></hbox>
|
||||
<hbox><label value='musicfave'/><textbox id='_favorite_music' preference='profile_musicfave'/></hbox>
|
||||
<hbox><label value='popstarfave'/><textbox id='_favorite_popstar' preference='profile_popstarfave'/></hbox>
|
||||
<hbox><label value='teamsfave'/><textbox id='_favorite_teams' preference='profile_teamsfave'/></hbox>
|
||||
<hbox><label value='televisionfave'/><textbox id='_favorite_television' preference='profile_televisionfave'/></hbox>
|
||||
<hbox><label value='visiblespeakaction'/><textbox id='_flag_action_speak_visible' preference='profile_visiblespeakaction'/></hbox>
|
||||
<hbox><label value='ignorecolors'/><textbox id='_flag_colors_ignore' preference='profile_ignorecolors'/></hbox>
|
||||
<hbox><label value='echo'/><textbox id='_flag_echo' preference='profile_echo'/></hbox>
|
||||
<hbox><label value='filter'/><textbox id='_flag_filter_strangers' preference='profile_filter'/></hbox>
|
||||
<hbox><label value='exposefriends'/><textbox id='_flag_friends_expose' preference='profile_exposefriends'/></hbox>
|
||||
<hbox><label value='greeting'/><textbox id='_flag_greeting' preference='profile_greeting'/></hbox>
|
||||
<hbox><label value='multipleplaces'/><textbox id='_flag_places_multiple' preference='profile_multipleplaces'/></hbox>
|
||||
<hbox><label value='ctcppresence'/><textbox id='_flag_presence_ctcp' preference='profile_ctcppresence'/></hbox>
|
||||
<hbox><label value='clearscreen'/><textbox id='_flag_screen_clear' preference='profile_clearscreen'/></hbox>
|
||||
<hbox><label value='verbatimuniform'/><textbox id='_flag_uniform_verbatim' preference='profile_verbatimuniform'/></hbox>
|
||||
<hbox><label value='visibility'/><textbox id='_flag_visibility' preference='profile_visibility'/></hbox>
|
||||
<hbox><label value='sex'/><textbox id='_gender' preference='profile_sex'/></hbox>
|
||||
<hbox><label value='id'/><textbox id='_identification' preference='profile_id'/></hbox>
|
||||
<hbox><label value='otherid'/><textbox id='_identification_other' preference='profile_otherid'/></hbox>
|
||||
<hbox><label value='aimid'/><textbox id='_identification_scheme_AIM' preference='profile_aimid'/></hbox>
|
||||
<hbox><label value='icqid'/><textbox id='_identification_scheme_ICQ' preference='profile_icqid'/></hbox>
|
||||
<hbox><label value='msnid'/><textbox id='_identification_scheme_MSN' preference='profile_msnid'/></hbox>
|
||||
<hbox><label value='sipid'/><textbox id='_identification_scheme_SIP' preference='profile_sipid'/></hbox>
|
||||
<hbox><label value='skypeid'/><textbox id='_identification_scheme_Skype' preference='profile_skypeid'/></hbox>
|
||||
<hbox><label value='xmppid'/><textbox id='_identification_scheme_XMPP' preference='profile_xmppid'/></hbox>
|
||||
<hbox><label value='yahooid'/><textbox id='_identification_scheme_Yahoo' preference='profile_yahooid'/></hbox>
|
||||
<hbox><label value='email'/><textbox id='_identification_scheme_mailto' preference='profile_email'/></hbox>
|
||||
<hbox><label value='videophoneid'/><textbox id='_identification_videophone' preference='profile_videophoneid'/></hbox>
|
||||
<hbox><label value='characterimage'/><textbox id='_image_character' preference='profile_characterimage'/></hbox>
|
||||
<hbox><label value='language'/><textbox id='_language' preference='profile_language'/></hbox>
|
||||
<hbox><label value='alternatelanguage'/><textbox id='_language_alternate' preference='profile_alternatelanguage'/></hbox>
|
||||
<hbox><label value='optionallanguage'/><textbox id='_language_optional' preference='profile_optionallanguage'/></hbox>
|
||||
<hbox><label value='worklocation'/><textbox id='_location_work' preference='profile_worklocation'/></hbox>
|
||||
<hbox><label value='worklogin'/><textbox id='_login_work' preference='profile_worklogin'/></hbox>
|
||||
<hbox><label value='familyname'/><textbox id='_name_family' preference='profile_familyname'/></hbox>
|
||||
<hbox><label value='givenname'/><textbox id='_name_given' preference='profile_givenname'/></hbox>
|
||||
<hbox><label value='middlename'/><textbox id='_name_middle' preference='profile_middlename'/></hbox>
|
||||
<hbox><label value='patronymicname'/><textbox id='_name_patronymic' preference='profile_patronymicname'/></hbox>
|
||||
<hbox><label value='prefixname'/><textbox id='_name_prefix' preference='profile_prefixname'/></hbox>
|
||||
<hbox><label value='publicname'/><textbox id='_name_public' preference='profile_publicname'/></hbox>
|
||||
<hbox><label value='suffixname'/><textbox id='_name_suffix' preference='profile_suffixname'/></hbox>
|
||||
<hbox><label value='alternatenick'/><textbox id='_nick_alternate' preference='profile_alternatenick'/></hbox>
|
||||
<hbox><label value='name'/><textbox id='_nick_profile' preference='profile_name'/></hbox>
|
||||
<hbox><label value='longname'/><textbox id='_nick_spaced' preference='profile_longname'/></hbox>
|
||||
<hbox><label value='biographypage'/><textbox id='_page_biography' preference='profile_biographypage'/></hbox>
|
||||
<hbox><label value='diarypage'/><textbox id='_page_diary' preference='profile_diarypage'/></hbox>
|
||||
<hbox><label value='linkspage'/><textbox id='_page_links' preference='profile_linkspage'/></hbox>
|
||||
<hbox><label value='photopage'/><textbox id='_page_photo' preference='profile_photopage'/></hbox>
|
||||
<hbox><label value='privatepage'/><textbox id='_page_private' preference='profile_privatepage'/></hbox>
|
||||
<hbox><label value='publicpage'/><textbox id='_page_public' preference='profile_publicpage'/></hbox>
|
||||
<hbox><label value='publicationspage'/><textbox id='_page_publications' preference='profile_publicationspage'/></hbox>
|
||||
<hbox><label value='resumepage'/><textbox id='_page_resume' preference='profile_resumepage'/></hbox>
|
||||
<hbox><label value='startpage'/><textbox id='_page_start' preference='profile_startpage'/></hbox>
|
||||
<hbox><label value='statuspage'/><textbox id='_page_status' preference='profile_statuspage'/></hbox>
|
||||
<hbox><label value='workpage'/><textbox id='_page_work' preference='profile_workpage'/></hbox>
|
||||
<hbox><label value='password'/><textbox id='_password' preference='profile_password'/></hbox>
|
||||
<hbox><label value='workassistant'/><textbox id='_person_assistant_work' preference='profile_workassistant'/></hbox>
|
||||
<hbox><label value='workmanager'/><textbox id='_person_manager_work' preference='profile_workmanager'/></hbox>
|
||||
<hbox><label value='home'/><textbox id='_place_home' preference='profile_home'/></hbox>
|
||||
<hbox><label value='profession'/><textbox id='_profession' preference='profile_profession'/></hbox>
|
||||
<hbox><label value='workrole'/><textbox id='_role_work' preference='profile_workrole'/></hbox>
|
||||
<hbox><label value='presencefilter'/><textbox id='_select_filter_presence' preference='profile_presencefilter'/></hbox>
|
||||
<hbox><label value='worktitle'/><textbox id='_title_work' preference='profile_worktitle'/></hbox>
|
||||
<hbox><label value='privatefoaffile'/><textbox id='_uniform_FOAF_private' preference='profile_privatefoaffile'/></hbox>
|
||||
<hbox><label value='publicfoaffile'/><textbox id='_uniform_FOAF_public' preference='profile_publicfoaffile'/></hbox>
|
||||
<hbox><label value='characterfile'/><textbox id='_uniform_character' preference='profile_characterfile'/></hbox>
|
||||
<hbox><label value='keyfile'/><textbox id='_uniform_key_public' preference='profile_keyfile'/></hbox>
|
||||
<hbox><label value='photofile'/><textbox id='_uniform_photo' preference='profile_photofile'/></hbox>
|
||||
<hbox><label value='miniphotofile'/><textbox id='_uniform_photo_small' preference='profile_miniphotofile'/></hbox>
|
||||
<hbox><label value='stylefile'/><textbox id='_uniform_style' preference='profile_stylefile'/></hbox>
|
||||
<hbox><label value='workunit'/><textbox id='_unit_work' preference='profile_workunit'/></hbox>
|
@ -2648,22 +2648,28 @@ quit(immediate, variant) {
|
||||
}
|
||||
#ifndef _flag_disable_module_presence
|
||||
switch(v("scheme")) {
|
||||
// psyc clients are supposed to always explicitely set
|
||||
// a user's presence status. this is probably too blue-eyed
|
||||
// and needs a /set'ting at least. maybe we should have a
|
||||
// setting to skip over all of the following decisions -
|
||||
// like a delayed unavailability automation.
|
||||
case "psyc":
|
||||
// jabber/user:quit() is called on @type 'unavailable'
|
||||
// so it relies on quit() to announce offline status
|
||||
//case "jabber":
|
||||
// break;
|
||||
# ifdef _flag_enable_manual_announce_telnet
|
||||
case "tn":
|
||||
break;
|
||||
# endif
|
||||
# ifdef _flag_enable_manual_announce_IRC
|
||||
case "irc":
|
||||
# endif
|
||||
break;
|
||||
# endif
|
||||
// psyc clients are supposed to explicitely set a user's presence
|
||||
// status before exiting, if the user wishes so. only if they are
|
||||
// not performing a clean exit, we will presume that an OFFLINE
|
||||
// availability is appropriate. maybe a separate AVAILABILITY_LOST
|
||||
// value would be nice. and we should have a delayed unavailability
|
||||
// automation feature here to avoid frequent relogin announcements.
|
||||
case "psyc":
|
||||
if (variant != "_disconnect") break;
|
||||
// fall thru in case of _disconnect
|
||||
// which indicates, we died an irregular death
|
||||
default:
|
||||
# ifdef CACHE_PRESENCE
|
||||
//announce(AVAILABILITY_OFFLINE, 0, ask4upd8s == 0);
|
||||
|
@ -1,5 +0,0 @@
|
||||
// model '_' generated by '/home/lynx/bin/psyconf'
|
||||
|
||||
#define ESSENTIALS
|
||||
|
||||
#include "archetype.gen"
|
@ -1,6 +0,0 @@
|
||||
// model '_h' generated by '/home/lynx/bin/psyconf'
|
||||
|
||||
#define ESSENTIALS
|
||||
#define PLACE_HISTORY
|
||||
|
||||
#include "archetype.gen"
|
@ -1,7 +0,0 @@
|
||||
// model '_he' generated by '/home/lynx/bin/psyconf'
|
||||
|
||||
#define ESSENTIALS
|
||||
#define PLACE_HISTORY
|
||||
#define PLACE_HISTORY_EXPORT
|
||||
|
||||
#include "archetype.gen"
|
@ -1,8 +0,0 @@
|
||||
// model '_hem' generated by '/home/lynx/bin/psyconf'
|
||||
|
||||
#define ESSENTIALS
|
||||
#define PLACE_HISTORY
|
||||
#define PLACE_HISTORY_EXPORT
|
||||
#define PLACE_MASQUERADE
|
||||
|
||||
#include "archetype.gen"
|
@ -1,9 +0,0 @@
|
||||
// model '_hemo' generated by '/home/lynx/bin/psyconf'
|
||||
|
||||
#define ESSENTIALS
|
||||
#define PLACE_HISTORY
|
||||
#define PLACE_HISTORY_EXPORT
|
||||
#define PLACE_MASQUERADE
|
||||
#define PLACE_OWNED
|
||||
|
||||
#include "archetype.gen"
|
@ -1,8 +0,0 @@
|
||||
// model '_heo' generated by '/home/lynx/bin/psyconf'
|
||||
|
||||
#define ESSENTIALS
|
||||
#define PLACE_HISTORY
|
||||
#define PLACE_HISTORY_EXPORT
|
||||
#define PLACE_OWNED
|
||||
|
||||
#include "archetype.gen"
|
@ -1,8 +0,0 @@
|
||||
// model '_hes' generated by '/home/lynx/bin/psyconf'
|
||||
|
||||
#define ESSENTIALS
|
||||
#define PLACE_HISTORY
|
||||
#define PLACE_HISTORY_EXPORT
|
||||
#define PLACE_SCRATCHPAD
|
||||
|
||||
#include "archetype.gen"
|
@ -1,9 +0,0 @@
|
||||
// model '_hesm' generated by '/home/lynx/bin/psyconf'
|
||||
|
||||
#define ESSENTIALS
|
||||
#define PLACE_HISTORY
|
||||
#define PLACE_HISTORY_EXPORT
|
||||
#define PLACE_SCRATCHPAD
|
||||
#define PLACE_MASQUERADE
|
||||
|
||||
#include "archetype.gen"
|
@ -1,10 +0,0 @@
|
||||
// model '_hesmo' generated by '/home/lynx/bin/psyconf'
|
||||
|
||||
#define ESSENTIALS
|
||||
#define PLACE_HISTORY
|
||||
#define PLACE_HISTORY_EXPORT
|
||||
#define PLACE_SCRATCHPAD
|
||||
#define PLACE_MASQUERADE
|
||||
#define PLACE_OWNED
|
||||
|
||||
#include "archetype.gen"
|
@ -1,9 +0,0 @@
|
||||
// model '_heso' generated by '/home/lynx/bin/psyconf'
|
||||
|
||||
#define ESSENTIALS
|
||||
#define PLACE_HISTORY
|
||||
#define PLACE_HISTORY_EXPORT
|
||||
#define PLACE_SCRATCHPAD
|
||||
#define PLACE_OWNED
|
||||
|
||||
#include "archetype.gen"
|
@ -1,7 +0,0 @@
|
||||
// model '_hm' generated by '/home/lynx/bin/psyconf'
|
||||
|
||||
#define ESSENTIALS
|
||||
#define PLACE_HISTORY
|
||||
#define PLACE_MASQUERADE
|
||||
|
||||
#include "archetype.gen"
|
@ -1,8 +0,0 @@
|
||||
// model '_hmo' generated by '/home/lynx/bin/psyconf'
|
||||
|
||||
#define ESSENTIALS
|
||||
#define PLACE_HISTORY
|
||||
#define PLACE_MASQUERADE
|
||||
#define PLACE_OWNED
|
||||
|
||||
#include "archetype.gen"
|
@ -1,7 +0,0 @@
|
||||
// model '_ho' generated by '/home/lynx/bin/psyconf'
|
||||
|
||||
#define ESSENTIALS
|
||||
#define PLACE_HISTORY
|
||||
#define PLACE_OWNED
|
||||
|
||||
#include "archetype.gen"
|
@ -1,7 +0,0 @@
|
||||
// model '_hs' generated by '/home/lynx/bin/psyconf'
|
||||
|
||||
#define ESSENTIALS
|
||||
#define PLACE_HISTORY
|
||||
#define PLACE_SCRATCHPAD
|
||||
|
||||
#include "archetype.gen"
|
@ -1,8 +0,0 @@
|
||||
// model '_hsm' generated by '/home/lynx/bin/psyconf'
|
||||
|
||||
#define ESSENTIALS
|
||||
#define PLACE_HISTORY
|
||||
#define PLACE_SCRATCHPAD
|
||||
#define PLACE_MASQUERADE
|
||||
|
||||
#include "archetype.gen"
|
@ -1,9 +0,0 @@
|
||||
// model '_hsmo' generated by '/home/lynx/bin/psyconf'
|
||||
|
||||
#define ESSENTIALS
|
||||
#define PLACE_HISTORY
|
||||
#define PLACE_SCRATCHPAD
|
||||
#define PLACE_MASQUERADE
|
||||
#define PLACE_OWNED
|
||||
|
||||
#include "archetype.gen"
|
@ -1,8 +0,0 @@
|
||||
// model '_hso' generated by '/home/lynx/bin/psyconf'
|
||||
|
||||
#define ESSENTIALS
|
||||
#define PLACE_HISTORY
|
||||
#define PLACE_SCRATCHPAD
|
||||
#define PLACE_OWNED
|
||||
|
||||
#include "archetype.gen"
|
@ -1,6 +0,0 @@
|
||||
// model '_m' generated by '/home/lynx/bin/psyconf'
|
||||
|
||||
#define ESSENTIALS
|
||||
#define PLACE_MASQUERADE
|
||||
|
||||
#include "archetype.gen"
|
@ -1,7 +0,0 @@
|
||||
// model '_mo' generated by '/home/lynx/bin/psyconf'
|
||||
|
||||
#define ESSENTIALS
|
||||
#define PLACE_MASQUERADE
|
||||
#define PLACE_OWNED
|
||||
|
||||
#include "archetype.gen"
|
@ -1,6 +0,0 @@
|
||||
// model '_o' generated by '/home/lynx/bin/psyconf'
|
||||
|
||||
#define ESSENTIALS
|
||||
#define PLACE_OWNED
|
||||
|
||||
#include "archetype.gen"
|
@ -1,6 +0,0 @@
|
||||
// model '_s' generated by '/home/lynx/bin/psyconf'
|
||||
|
||||
#define ESSENTIALS
|
||||
#define PLACE_SCRATCHPAD
|
||||
|
||||
#include "archetype.gen"
|
@ -1,7 +0,0 @@
|
||||
// model '_sm' generated by '/home/lynx/bin/psyconf'
|
||||
|
||||
#define ESSENTIALS
|
||||
#define PLACE_SCRATCHPAD
|
||||
#define PLACE_MASQUERADE
|
||||
|
||||
#include "archetype.gen"
|
@ -1,8 +0,0 @@
|
||||
// model '_smo' generated by '/home/lynx/bin/psyconf'
|
||||
|
||||
#define ESSENTIALS
|
||||
#define PLACE_SCRATCHPAD
|
||||
#define PLACE_MASQUERADE
|
||||
#define PLACE_OWNED
|
||||
|
||||
#include "archetype.gen"
|
@ -1,7 +0,0 @@
|
||||
// model '_so' generated by '/home/lynx/bin/psyconf'
|
||||
|
||||
#define ESSENTIALS
|
||||
#define PLACE_SCRATCHPAD
|
||||
#define PLACE_OWNED
|
||||
|
||||
#include "archetype.gen"
|
0
world/net/place/archetype.pl
Normal file → Executable file
0
world/net/place/archetype.pl
Normal file → Executable file
@ -1,5 +1,5 @@
|
||||
// vim:foldmethod=marker:syntax=lpc:noexpandtab
|
||||
// $Id: parse.i,v 1.357 2008/12/18 17:45:45 lynx Exp $
|
||||
// $Id: parse.i,v 1.358 2008/12/27 00:42:04 lynx Exp $
|
||||
//
|
||||
#ifndef FORK
|
||||
|
||||
@ -1135,7 +1135,7 @@ vamixed startParse(string a) {
|
||||
"Could not instantiate PSYC parser. Weird.");
|
||||
QUIT
|
||||
}
|
||||
if (isServer()) o->greet();
|
||||
// if (isServer()) o->greet();
|
||||
o->feed("|\n");
|
||||
return 1;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
// vim:foldmethod=marker:syntax=lpc:noexpandtab
|
||||
// $Id: server.c,v 1.18 2008/12/18 18:16:14 lynx Exp $
|
||||
// $Id: server.c,v 1.19 2008/12/27 00:42:04 lynx Exp $
|
||||
//
|
||||
// the thing that answers on port 4404 of psyced.
|
||||
|
||||
@ -61,6 +61,26 @@ disconnected(remaining) {
|
||||
return rc;
|
||||
}
|
||||
|
||||
// this only gets called from net/psyc.. FIXME
|
||||
void greet() {
|
||||
// should be doing sTextPath(); here ?
|
||||
// should be sharing code with net/psyc and do a proper greeting
|
||||
// three separate packets follow (thus three emits)
|
||||
//emit(S_GLYPH_PACKET_DELIMITER "\n");
|
||||
emit("\
|
||||
:_source\t"+ query_server_unl() +"\n\
|
||||
:_target_peer\tpsyc://"+ peeraddr +"/\n\
|
||||
\n\
|
||||
_notice_circuit_established\n" S_GLYPH_PACKET_DELIMITER "\n");
|
||||
emit("\
|
||||
:_source\t"+ query_server_unl() +"\n\
|
||||
\n\
|
||||
_status_circuit\n" S_GLYPH_PACKET_DELIMITER "\n");
|
||||
#ifdef _flag_log_sockets_SPYC
|
||||
log_file("RAW_SPYC", "» %O greeted.\n", ME);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void resolved(mixed host, mixed tag) {
|
||||
PT(("resolved %O to %O\n", peerip, host))
|
||||
string numericpeeraddr;
|
||||
@ -152,33 +172,13 @@ static void resolved(mixed host, mixed tag) {
|
||||
}
|
||||
resume_parse();
|
||||
sTextPath();
|
||||
greet();
|
||||
|
||||
// FIXME: determine response to greeting
|
||||
// instead of this dummy
|
||||
msg(0, "_notice_features", 0, tag ? ([ "_tag_reply" : tag ]) : 0);
|
||||
}
|
||||
|
||||
// this only gets called from net/psyc.. FIXME
|
||||
void greet() {
|
||||
// should be doing sTextPath(); here ?
|
||||
// should be sharing code with net/psyc and do a proper greeting
|
||||
// three separate packets follow (thus three emits)
|
||||
emit(S_GLYPH_PACKET_DELIMITER "\n");
|
||||
emit("\
|
||||
:_source\t"+ query_server_unl() +"\n\
|
||||
:_target_peer\tpsyc://"+ peeraddr +"/\n\
|
||||
\n\
|
||||
_notice_circuit_established\n" S_GLYPH_PACKET_DELIMITER "\n");
|
||||
emit("\
|
||||
:_source\t"+ query_server_unl() +"\n\
|
||||
\n\
|
||||
_status_circuit\n"); // S_GLYPH_PACKET_DELIMITER "\n");
|
||||
// last pipe is generated by fippo's code
|
||||
#ifdef _flag_log_sockets_SPYC
|
||||
log_file("RAW_SPYC", "» %O greeted.\n", ME);
|
||||
#endif
|
||||
}
|
||||
|
||||
void circuit_msg(string mc, mapping vars, string data) {
|
||||
switch(mc) {
|
||||
case "_request_features": // only servers handle _request_features
|
||||
|
@ -1,5 +1,5 @@
|
||||
// vim:noexpandtab:syntax=lpc
|
||||
// $Id: usercmd.i,v 1.698 2008/11/27 13:22:27 lynx Exp $
|
||||
// $Id: usercmd.i,v 1.699 2008/12/27 00:42:04 lynx Exp $
|
||||
//
|
||||
// usercmd is normally just a part of the user object focused on implementing
|
||||
// the user command set. it can also be used for implementing a subset of
|
||||
@ -1367,17 +1367,21 @@ cmd(a, args, dest, command) {
|
||||
case "warn":
|
||||
case "kill":
|
||||
if (sizeof(args) > 1) ob = find_person(args[1]);
|
||||
t = sizeof(args) > 2 ? ARGS(2) : 0;
|
||||
|
||||
printf("%s %O %O: %s\n\n", a, ob, t,
|
||||
ob ? "executed" : "no such person");
|
||||
else {
|
||||
w("_warning_usage_"+a,
|
||||
"Usage: /"+a+" <nick> [<message>]");
|
||||
return 1;
|
||||
}
|
||||
if (ob) {
|
||||
t = sizeof(args) > 2 ? ARGS(2) : 0;
|
||||
// log first, after kill ob will be 0
|
||||
log_file("BEHAVIOUR", "[%s] %O %ss %O: %O\n",
|
||||
ctime(), ME, a, ob, t);
|
||||
// call_other(ob, a, t);
|
||||
w("_echo_"+a, "[_entity] "+a+"ed.", ([
|
||||
"_entity": ob ]));
|
||||
ob -> sanction(a, t);
|
||||
}
|
||||
} else w("_error_unknown_name_user", 0, ([
|
||||
"_nick_target": args[1] ]));
|
||||
return 1;
|
||||
case "config":
|
||||
if (sizeof(args) < 3) return
|
||||
@ -2295,13 +2299,19 @@ protected friend(rm, entity, ni, trustee) {
|
||||
// the entity is an xmpp or icq or whatever uniform
|
||||
if (stringp(entity))
|
||||
deregister_context(ME, entity);
|
||||
if (friends[entity]) {
|
||||
// TODO: gender support
|
||||
sendmsg(entity, "_notice_friendship_removed",
|
||||
"[_nick] deletes [_possessive] friendship with you.",
|
||||
([ "_nick": MYNICK, "_possessive": "the" ]) );
|
||||
m_delete(friends, entity);
|
||||
}
|
||||
// this does not consider the case when we just
|
||||
// offered a friendship to a person. XMPP behaviour
|
||||
// is to let the other side know about our "mistake".
|
||||
// if noone has hard feelings about this, we should
|
||||
// choose to behave compatibly, which in this case
|
||||
// simply means to remove this if check.
|
||||
//if (friends[entity]) {
|
||||
sendmsg(entity, "_notice_friendship_removed",
|
||||
"[_nick] deletes [_possessive] friendship with you.",
|
||||
// TODO: gender support
|
||||
([ "_nick": MYNICK, "_possessive": "the" ]) );
|
||||
m_delete(friends, entity);
|
||||
//}
|
||||
return 1;
|
||||
}
|
||||
w("_error_unknown_friendship",
|
||||
|
@ -257,7 +257,7 @@ xmlparse(a) {
|
||||
# ifdef JABBER_TRANSPARENCY
|
||||
ixbuf = lasta = 0;
|
||||
innerxml = ixbuf;
|
||||
#endif
|
||||
# endif
|
||||
// handle stuff
|
||||
funcall(nodeHandler, currentnode);
|
||||
currentnode = 0;
|
||||
|
@ -1,65 +0,0 @@
|
||||
// $Id: parse.c,v 1.10 2005/03/14 10:23:28 lynx Exp $ // vim:syntax=lpc
|
||||
//
|
||||
// the actual RSS parser
|
||||
// why the file is called "parse.c" i don't know
|
||||
// it certainly wouldn't be a good idea to have several parsers in one file
|
||||
// so you may as well rename it into rss.c? TODO
|
||||
//
|
||||
#include <net.h>
|
||||
inherit NET_PATH "xml/common";
|
||||
|
||||
xmlparse(str) {
|
||||
// DOM-style XML parser for parsing RSS and RDF
|
||||
// see CHANGESTODO for discussion on how to make it compliant
|
||||
mapping dom;
|
||||
string namespace;
|
||||
string tag, lasttag, data, params;
|
||||
int pos, close;
|
||||
|
||||
pos = 0;
|
||||
close = -1;
|
||||
namespace = "";
|
||||
dom = ([ ]);
|
||||
while(pos = strstr(str, "<", pos) + 1){
|
||||
// D2(D("looping xmlparser...\n");)
|
||||
data = xmlunquote(str[close + 1..pos - 2]);
|
||||
close = strstr(str, ">", pos);
|
||||
sscanf(str[pos..close - 1], "%s%t%s", tag, params) || tag = str[pos..close - 1];
|
||||
if (strlen(tag) && (tag[0] == '!' || tag[0] == '?' || tag[0..2] == "rdf" || tag[0..2] == "rss")) {
|
||||
if(tag[0..2] == "rdf" || tag[0..2] == "rss")
|
||||
dom["type"] = tag[0..2];
|
||||
} else if (strlen(tag) && tag[0] == '/') {
|
||||
// D2(D("closing " + tag + "\n");)
|
||||
// closing tag
|
||||
if (tag[1..] != lasttag){
|
||||
// D2(D("warning: XML may be malformed\n");)
|
||||
;
|
||||
} else {
|
||||
// handle data
|
||||
if (data != "\n") {
|
||||
if (stringp(dom[namespace]) )
|
||||
dom[namespace] = ({ dom[namespace], data });
|
||||
else if (pointerp(dom[namespace]))
|
||||
dom[namespace] += ({ data });
|
||||
else
|
||||
dom[namespace] = data;
|
||||
}
|
||||
namespace = namespace[..<strlen(lasttag) + 2];
|
||||
lasttag = explode(namespace, "_")[<1];
|
||||
}
|
||||
} else {
|
||||
// open tag
|
||||
if ((params && params[<1] == '/') || tag[<1] == '/') {
|
||||
// better than before, but not really
|
||||
// correct to simply skip it
|
||||
continue;
|
||||
}
|
||||
// D2(D("opening " + tag + "\n");)
|
||||
namespace += "_" + tag;
|
||||
lasttag = tag;
|
||||
}
|
||||
pos = close;
|
||||
}
|
||||
// P2(("DOM: %O\n", dom))
|
||||
return dom;
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
// $Id: common.c,v 1.8 2005/03/14 10:23:28 lynx Exp $ // vim:syntax=lpc
|
||||
//
|
||||
// yes even we can't avoid having XML parsing classes
|
||||
// used by jabber and RSS (place/news)
|
||||
//
|
||||
#include <interface.h>
|
||||
|
||||
#include "xml.h"
|
||||
|
||||
string xmlquote(string s) {
|
||||
// return xml escaped version of s
|
||||
s = replace(s, "&", "&");
|
||||
s = replace(s, "<", "<");
|
||||
s = replace(s, ">", ">");
|
||||
s = replace(s, "\"", """);
|
||||
s = replace(s, "'", "'");
|
||||
return s;
|
||||
}
|
||||
|
||||
string xmlunquote(string s) {
|
||||
// return unquoted xml version of s
|
||||
s = replace(s, "&", "&");
|
||||
s = replace(s, "<", "<");
|
||||
s = replace(s, ">", ">");
|
||||
s = replace(s, """, "\"");
|
||||
s = replace(s, "'", "'");
|
||||
// should this take care of ß-style thingies
|
||||
// s = regreplace(s, "ß", 223);
|
||||
s = regreplace(s, "&#[0-9][0-9][0-9];",
|
||||
(: return sprintf("%c", to_int($1[2..<2])); :), 1);
|
||||
return s;
|
||||
}
|
@ -1,65 +0,0 @@
|
||||
// $Id: parse.c,v 1.10 2005/03/14 10:23:28 lynx Exp $ // vim:syntax=lpc
|
||||
//
|
||||
// the actual RSS parser
|
||||
// why the file is called "parse.c" i don't know
|
||||
// it certainly wouldn't be a good idea to have several parsers in one file
|
||||
// so you may as well rename it into rss.c? TODO
|
||||
//
|
||||
#include <net.h>
|
||||
inherit NET_PATH "xml/common";
|
||||
|
||||
rssparse(str) {
|
||||
// DOM-style XML parser for parsing RSS and RDF
|
||||
// see CHANGESTODO for discussion on how to make it compliant
|
||||
mapping dom;
|
||||
string namespace;
|
||||
string tag, lasttag, data, params;
|
||||
int pos, close;
|
||||
|
||||
pos = 0;
|
||||
close = -1;
|
||||
namespace = "";
|
||||
dom = ([ ]);
|
||||
while(pos = strstr(str, "<", pos) + 1){
|
||||
// D2(D("looping xmlparser...\n");)
|
||||
data = xmlunquote(str[close + 1..pos - 2]);
|
||||
close = strstr(str, ">", pos);
|
||||
sscanf(str[pos..close - 1], "%s%t%s", tag, params) || tag = str[pos..close - 1];
|
||||
if (strlen(tag) && (tag[0] == '!' || tag[0] == '?' || tag[0..2] == "rdf" || tag[0..2] == "rss")) {
|
||||
if(tag[0..2] == "rdf" || tag[0..2] == "rss")
|
||||
dom["type"] = tag[0..2];
|
||||
} else if (strlen(tag) && tag[0] == '/') {
|
||||
// D2(D("closing " + tag + "\n");)
|
||||
// closing tag
|
||||
if (tag[1..] != lasttag){
|
||||
// D2(D("warning: XML may be malformed\n");)
|
||||
;
|
||||
} else {
|
||||
// handle data
|
||||
if (data != "\n") {
|
||||
if (stringp(dom[namespace]) )
|
||||
dom[namespace] = ({ dom[namespace], data });
|
||||
else if (pointerp(dom[namespace]))
|
||||
dom[namespace] += ({ data });
|
||||
else
|
||||
dom[namespace] = data;
|
||||
}
|
||||
namespace = namespace[..<strlen(lasttag) + 2];
|
||||
lasttag = explode(namespace, "_")[<1];
|
||||
}
|
||||
} else {
|
||||
// open tag
|
||||
if ((params && params[<1] == '/') || tag[<1] == '/') {
|
||||
// better than before, but not really
|
||||
// correct to simply skip it
|
||||
continue;
|
||||
}
|
||||
// D2(D("opening " + tag + "\n");)
|
||||
namespace += "_" + tag;
|
||||
lasttag = tag;
|
||||
}
|
||||
pos = close;
|
||||
}
|
||||
// P2(("DOM: %O\n", dom))
|
||||
return dom;
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
// $Id: common.c,v 1.8 2005/03/14 10:23:28 lynx Exp $ // vim:syntax=lpc
|
||||
//
|
||||
// yes even we can't avoid having XML parsing classes
|
||||
// used by jabber and RSS (place/news)
|
||||
//
|
||||
#include <interface.h>
|
||||
|
||||
#include "xml.h"
|
||||
|
||||
string xmlquote(string s) {
|
||||
// return xml escaped version of s
|
||||
s = replace(s, "&", "&");
|
||||
s = replace(s, "<", "<");
|
||||
s = replace(s, ">", ">");
|
||||
s = replace(s, "\"", """);
|
||||
s = replace(s, "'", "'");
|
||||
return s;
|
||||
}
|
||||
|
||||
string xmlunquote(string s) {
|
||||
// return unquoted xml version of s
|
||||
s = replace(s, "&", "&");
|
||||
s = replace(s, "<", "<");
|
||||
s = replace(s, ">", ">");
|
||||
s = replace(s, """, "\"");
|
||||
s = replace(s, "'", "'");
|
||||
// should this take care of ß-style thingies
|
||||
// s = regreplace(s, "ß", 223);
|
||||
s = regreplace(s, "&#[0-9][0-9][0-9];",
|
||||
(: return sprintf("%c", to_int($1[2..<2])); :), 1);
|
||||
return s;
|
||||
}
|
@ -1,110 +0,0 @@
|
||||
// $Id: parse.c,v 1.12 2005/06/07 07:03:02 fippo Exp $ // vim:syntax=lpc
|
||||
//
|
||||
// the actual RSS parser
|
||||
// why the file is called "parse.c" i don't know
|
||||
// it certainly wouldn't be a good idea to have several parsers in one file
|
||||
// so you may as well rename it into rss.c? TODO
|
||||
//
|
||||
#include <net.h>
|
||||
#include <xml.h>
|
||||
inherit NET_PATH "xml/common";
|
||||
|
||||
// DOM style XML parser
|
||||
xmlparse(a) {
|
||||
// this one is very similar to the jabber parser
|
||||
// from a syntax point of view
|
||||
string tag, data, params;
|
||||
int pos, close;
|
||||
int list;
|
||||
|
||||
XMLNode currentnode = 0;
|
||||
XMLNode nodestack = ({ });
|
||||
params = "";
|
||||
pos = 0;
|
||||
close = -1;
|
||||
|
||||
while(pos = strstr(a, "<", pos) + 1) {
|
||||
data = xmlunquote(a[close + 1..pos - 2]);
|
||||
close = strstr(a, ">", pos);
|
||||
|
||||
sscanf(a[pos..close - 1], "%s%t%s", tag, params) || tag = a[pos..close-1];
|
||||
if(tag == "") return -1;
|
||||
if (strlen(tag) && (tag[0] == '!' || tag[0] == '?')){
|
||||
// P2(("skipping tag starting with ! or ?\n"))
|
||||
} else if (strlen(tag) && tag[0] == '/'){
|
||||
P4(("should be closing tag %O and am closing %O\n",
|
||||
currentnode[Tag], tag[1..]))
|
||||
if (!currentnode || currentnode[Tag] != tag[1..]) {
|
||||
// unbalanced xml?
|
||||
} else {
|
||||
// schliessender tag gefunden, die haben keine Parameter
|
||||
if (strlen(data) && data != "\r\n" && data != "\n"){
|
||||
// not sure if this works correct
|
||||
unless(pointerp(currentnode[Cdata]))
|
||||
currentnode[Cdata] = data;
|
||||
else
|
||||
currentnode[Cdata] += ({ data });
|
||||
}
|
||||
if (sizeof(nodestack) == 0) {
|
||||
// we can probably break/return here
|
||||
break;
|
||||
} else {
|
||||
currentnode = nodestack[<1];
|
||||
nodestack = nodestack[..<2];
|
||||
}
|
||||
}
|
||||
} else { // opening tag
|
||||
int selfclosing;
|
||||
mixed newnode;
|
||||
string key, val;
|
||||
|
||||
if (strlen(params) && params[<1] == '/') {
|
||||
params = params[..<2];
|
||||
selfclosing = 1;
|
||||
newnode = new_XMLNode;
|
||||
} else if (tag[<1] == '/') {
|
||||
tag = tag[..<2];
|
||||
selfclosing = 1;
|
||||
newnode = new_XMLNode;
|
||||
} else {
|
||||
newnode = new_XMLNode;
|
||||
}
|
||||
if(currentnode){
|
||||
nodestack += ({ currentnode });
|
||||
if (pointerp(currentnode[Child][tag])) {
|
||||
unless (nodelistp(currentnode[Child][tag])) {
|
||||
// tranform
|
||||
currentnode[Child][tag] = ({ currentnode[Child][tag], newnode });
|
||||
} else {
|
||||
// append
|
||||
currentnode[Child][tag] += ({ newnode });
|
||||
}
|
||||
currentnode = currentnode[Child][tag][<1];
|
||||
} else {
|
||||
currentnode[Child][tag] = newnode;
|
||||
currentnode = currentnode[Child][tag];
|
||||
}
|
||||
} else {
|
||||
currentnode = newnode;
|
||||
}
|
||||
currentnode[Tag] = tag;
|
||||
foreach(string pa: explode(params, " ")) {
|
||||
if(sscanf(pa, "%s=\"%s\"", key, val) == 2 ||
|
||||
sscanf(pa, "%s=\'%s\'", key, val) == 2 ) {
|
||||
currentnode[Param][key] = val;
|
||||
|
||||
}
|
||||
}
|
||||
if (selfclosing) {
|
||||
if (sizeof(nodestack) == 0){
|
||||
PT(("nodestack empty\n"))
|
||||
} else {
|
||||
currentnode = nodestack[<1];
|
||||
nodestack = nodestack[..<2];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return currentnode;
|
||||
}
|
||||
|
@ -1,110 +0,0 @@
|
||||
// $Id: parse.c,v 1.12 2005/06/07 07:03:02 fippo Exp $ // vim:syntax=lpc
|
||||
//
|
||||
// the actual RSS parser
|
||||
// why the file is called "parse.c" i don't know
|
||||
// it certainly wouldn't be a good idea to have several parsers in one file
|
||||
// so you may as well rename it into rss.c? TODO
|
||||
//
|
||||
#include <net.h>
|
||||
#include <xml.h>
|
||||
inherit NET_PATH "xml/common";
|
||||
|
||||
// DOM style XML parser
|
||||
xmlparse(a) {
|
||||
// this one is very similar to the jabber parser
|
||||
// from a syntax point of view
|
||||
string tag, data, params;
|
||||
int pos, close;
|
||||
int list;
|
||||
|
||||
XMLNode currentnode = 0;
|
||||
XMLNode nodestack = ({ });
|
||||
params = "";
|
||||
pos = 0;
|
||||
close = -1;
|
||||
|
||||
while(pos = strstr(a, "<", pos) + 1) {
|
||||
data = xmlunquote(a[close + 1..pos - 2]);
|
||||
close = strstr(a, ">", pos);
|
||||
|
||||
sscanf(a[pos..close - 1], "%s%t%s", tag, params) || tag = a[pos..close-1];
|
||||
if(tag == "") return -1;
|
||||
if (strlen(tag) && (tag[0] == '!' || tag[0] == '?')){
|
||||
// P2(("skipping tag starting with ! or ?\n"))
|
||||
} else if (strlen(tag) && tag[0] == '/'){
|
||||
P4(("should be closing tag %O and am closing %O\n",
|
||||
currentnode[Tag], tag[1..]))
|
||||
if (!currentnode || currentnode[Tag] != tag[1..]) {
|
||||
// unbalanced xml?
|
||||
} else {
|
||||
// schliessender tag gefunden, die haben keine Parameter
|
||||
if (strlen(data) && data != "\r\n" && data != "\n"){
|
||||
// not sure if this works correct
|
||||
unless(pointerp(currentnode[Cdata]))
|
||||
currentnode[Cdata] = data;
|
||||
else
|
||||
currentnode[Cdata] += ({ data });
|
||||
}
|
||||
if (sizeof(nodestack) == 0) {
|
||||
// we can probably break/return here
|
||||
break;
|
||||
} else {
|
||||
currentnode = nodestack[<1];
|
||||
nodestack = nodestack[..<2];
|
||||
}
|
||||
}
|
||||
} else { // opening tag
|
||||
int selfclosing;
|
||||
mixed newnode;
|
||||
string key, val;
|
||||
|
||||
if (strlen(params) && params[<1] == '/') {
|
||||
params = params[..<2];
|
||||
selfclosing = 1;
|
||||
newnode = new_XMLNode;
|
||||
} else if (tag[<1] == '/') {
|
||||
tag = tag[..<2];
|
||||
selfclosing = 1;
|
||||
newnode = new_XMLNode;
|
||||
} else {
|
||||
newnode = new_XMLNode;
|
||||
}
|
||||
if(currentnode){
|
||||
nodestack += ({ currentnode });
|
||||
if (pointerp(currentnode[Child][tag])) {
|
||||
unless (nodelistp(currentnode[Child][tag])) {
|
||||
// tranform
|
||||
currentnode[Child][tag] = ({ currentnode[Child][tag], newnode });
|
||||
} else {
|
||||
// append
|
||||
currentnode[Child][tag] += ({ newnode });
|
||||
}
|
||||
currentnode = currentnode[Child][tag][<1];
|
||||
} else {
|
||||
currentnode[Child][tag] = newnode;
|
||||
currentnode = currentnode[Child][tag];
|
||||
}
|
||||
} else {
|
||||
currentnode = newnode;
|
||||
}
|
||||
currentnode[Tag] = tag;
|
||||
foreach(string pa: explode(params, " ")) {
|
||||
if(sscanf(pa, "%s=\"%s\"", key, val) == 2 ||
|
||||
sscanf(pa, "%s=\'%s\'", key, val) == 2 ) {
|
||||
currentnode[Param][key] = val;
|
||||
|
||||
}
|
||||
}
|
||||
if (selfclosing) {
|
||||
if (sizeof(nodestack) == 0){
|
||||
PT(("nodestack empty\n"))
|
||||
} else {
|
||||
currentnode = nodestack[<1];
|
||||
nodestack = nodestack[..<2];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return currentnode;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user