Lots of different room-related operations.
[Talk to the citadel server]


Functions

void initialize_viewdefs (void)
 initialize the viewdefs with localized strings
int is_view_allowed_as_default (int which_view)
 Determine which views are allowed as the default for creating a new room.
void load_floorlist (void)
 load the list of floors
void free_march_list (struct wcsession *wcf)
 Free a session's march list.
void remove_march (char *aaa)
 remove a room from the march list
void room_tree_list (struct roomlisting *rp)
 display rooms in tree structure???
int rordercmp (struct roomlisting *r1, struct roomlisting *r2)
 Room ordering stuff (compare first by floor, then by order).
void listrms (char *variety)
 Common code for all room listings.
void zapped_list (void)
 list all forgotten rooms
void readinfo (void)
 read this room's info file (set v to 1 for verbose mode)
void embed_room_graphic (void)
 Display room banner icon. The server doesn't actually need the room name, but we supply it in order to keep the browser from using a cached icon from another room.
void embed_view_o_matic (void)
 Display the current view and offer an option to change it.
void embed_search_o_matic (void)
 Display a search box.
void embed_room_banner (char *got, int navbar_style)
 Embed the room banner.
int gotoroom (char *gname)
 back end routine to take the session to a new room
char * pop_march (int desired_floor)
 Locate the room on the march list which we most want to go to. Each room is measured given a "weight" of preference based on various factors.
void gotonext (void)
 Goto next room having unread messages. We want to skip over rooms that the user has already been to, and take the user back to the lobby when done. The room we end up in is placed in newroom - which is set to 0 (the lobby) initially. We start the search in the current room rather than the beginning to prevent two or more concurrent users from dragging each other back to the same room.
void smart_goto (char *next_room)
 goto next room
void slrp_highest (void)
 mark all messages in current room as having been read
void ungoto (void)
 un-goto the previous room
int self_service (int newval)
 Set/clear/read the "self-service list subscribe" flag for a room.
void display_editroom (void)
 display the form for editing a room
void toggle_self_service (void)
 Toggle self-service list subscription.
void editroom (void)
 save new parameters for a room
void do_invt_kick (void)
 Display form for Invite, Kick, and show Who Knows a room.
void display_whok (void)
 Display form for Invite, Kick, and show Who Knows a room.
void display_entroom (void)
 display the form for entering a new room
void er_set_default_view (int newview)
 support function for entroom() -- sets the default view
void entroom (void)
 enter a new room
void display_private (char *rname, int req_pass)
 display the screen to enter a private room
void goto_private (void)
 goto a private room
void display_zap (void)
 display the screen to zap a room
void zap (void)
 zap a room
void delete_room (void)
 Delete the current room.
void netedit (void)
 Perform changes to a room's network configuration.
void room_to_folder (char *folder, char *room, int floor, int is_mailbox)
 Convert a room name to a folder-ish-looking name.
void do_change_view (int newview)
 Back end for change_view().
void change_view (void)
 Change the view for this room.
void do_folder_view (struct folder *fold, int max_folders, int num_floors)
 One big expanded tree list view --- like a folder list.
void do_rooms_view (struct folder *fold, int max_folders, int num_floors)
 Boxes and rooms and lists ... oh my!
void set_floordiv_expanded (char *which_floordiv)
 print a floor div???
void do_iconbar_view (struct folder *fold, int max_folders, int num_floors)
 view the iconbar
void list_all_rooms_by_floor (char *viewpref)
 Show the room list. (only should get called by knrooms() because that's where output_headers() is called from).
void knrooms (void)
 Do either a known rooms list or a folders list, depending on the user's preference.
void set_room_policy (void)
 Set the message expire policy for this room and/or floor.

Variables

char floorlist [128][SIZ]
char * viewdefs [8]

Function Documentation

int is_view_allowed_as_default ( int  which_view  ) 

Determine which views are allowed as the default for creating a new room.

Parameters:
which_view The view ID being queried.

< because it isn't finished yet

< should never get here

Definition at line 34 of file roomops.c.

Referenced by display_entroom().

void free_march_list ( struct wcsession wcf  ) 

Free a session's march list.

Parameters:
wcf Pointer to session being cleared

Definition at line 78 of file roomops.c.

References wcsession::march, and march::next.

void room_tree_list ( struct roomlisting rp  ) 

display rooms in tree structure???

Parameters:
rp the roomlist to build a tree from

Definition at line 127 of file roomops.c.

References escputs1(), roomlisting::lnext, roomlisting::rlflags, roomlisting::rlname, roomlisting::rnext, urlescputs(), and wprintf().

Referenced by listrms().

int rordercmp ( struct roomlisting r1,
struct roomlisting r2 
)

Room ordering stuff (compare first by floor, then by order).

Parameters:
r1 first roomlist to compare
r2 second roomlist co compare
Returns:
are they the same???

Definition at line 167 of file roomops.c.

References roomlisting::rlfloor, and roomlisting::rlorder.

Referenced by listrms().

void listrms ( char *  variety  ) 

Common code for all room listings.

Parameters:
variety what???

Ask the server for a room list

If no rooms were listed, print an nbsp to make the cell borders show up anyway.

Definition at line 191 of file roomops.c.

References extract_int(), extract_token(), roomlisting::lnext, roomlisting::rlflags, roomlisting::rlfloor, roomlisting::rlname, roomlisting::rlorder, roomlisting::rnext, room_tree_list(), rordercmp(), serv_getln(), serv_puts(), and wprintf().

Referenced by zapped_list().

void embed_view_o_matic ( void   ) 

Display the current view and offer an option to change it.

Only offer the views that make sense, given the default view for the room. For example, don't offer a Calendar view in a non-Calendar room.

< default

< mail or bulletin

< mail or bulletin

|| ( (i == 7) && (WC->wc_default_view == 3) ) (calendar list temporarily disabled)

Definition at line 378 of file roomops.c.

References escputs(), viewdefs, and wprintf().

Referenced by embed_room_banner().

void embed_room_banner ( char *  got,
int  navbar_style 
)

Embed the room banner.

Parameters:
got The information returned from a GOTO server command
navbar_style Determines which navigation buttons to display

We need to have the information returned by a GOTO server command. If it isn't supplied, we fake it by issuing our own GOTO.

The browser needs some information for its own use

If the user happens to select the "make this my start page" link, we want it to remember the URL as a "/dotskip" one instead of a "skip" or "gotonext" or something like that.

Check for new mail.

Definition at line 438 of file roomops.c.

References bstr(), do_template(), embed_room_graphic(), embed_search_o_matic(), embed_view_o_matic(), extract_int(), offer_start_page(), readinfo(), safestrncpy(), serv_getln(), serv_printf(), snprintf(), str_wiki_index(), svcallback(), svprintf(), and wprintf().

Referenced by display_enter(), and output_headers().

int gotoroom ( char *  gname  ) 

back end routine to take the session to a new room

Parameters:
gname room to go to

store ungoto information

move to the new room

Definition at line 723 of file roomops.c.

References extract_int(), extract_long(), extract_token(), remove_march(), serv_getln(), serv_printf(), and serv_puts().

Referenced by calendar_section(), display_edit_task(), display_enter(), display_rss(), display_smtpqueue_inner_div(), display_wiki_page(), editroom(), entroom(), smart_goto(), and tasks_section().

char* pop_march ( int  desired_floor  ) 

Locate the room on the march list which we most want to go to. Each room is measured given a "weight" of preference based on various factors.

Parameters:
desired_floor the room number on the citadel server
Returns:
the roomname

Definition at line 780 of file roomops.c.

References march::march_floor, march::march_name, march::march_order, and march::next.

Referenced by gotonext().

void gotonext ( void   ) 

Goto next room having unread messages. We want to skip over rooms that the user has already been to, and take the user back to the lobby when done. The room we end up in is placed in newroom - which is set to 0 (the lobby) initially. We start the search in the current room rather than the beginning to prevent two or more concurrent users from dragging each other back to the same room.

First check to see if the march-mode list is already allocated. If it is, pop the first room off the list and go there.

add _BASEROOM_ to the end of the march list, so the user will end up in the system base room (usually the Lobby>) at the end of the loop

...and remove the room we're currently in, so a <G>oto doesn't make us walk around in circles

Definition at line 823 of file roomops.c.

References extract_int(), extract_token(), march::march_floor, march::march_name, march::march_order, march::next, pop_march(), remove_march(), safestrncpy(), serv_getln(), serv_puts(), and smart_goto().

Referenced by session_loop().

void smart_goto ( char *  next_room  ) 

goto next room

Parameters:
next_room next room to go to

Definition at line 893 of file roomops.c.

References gotoroom(), and readloop().

Referenced by delete_room(), do_change_view(), do_chat(), goto_private(), gotonext(), save_edit(), session_loop(), ungoto(), and zap().

int self_service ( int  newval  ) 

Set/clear/read the "self-service list subscribe" flag for a room.

Parameters:
newval set to 0 to clear, 1 to set, any other value to leave unchanged.
Returns:
return the new value.

Definition at line 949 of file roomops.c.

References extract_int(), extract_token(), serv_getln(), serv_printf(), and serv_puts().

Referenced by display_editroom(), and toggle_self_service().

void display_editroom ( void   ) 

display the form for editing a room

print the tabbed dialog

end tabbed dialog

begin content of whatever tab is open now

directory stuff

end of directory stuff

start of anon options

Sharing the room with other Citadel nodes...

Learn the current configuration

Display the stuff

Mailing list management

Pop open an address book -- begin

Pop open an address book -- end

Mailing list management

Mailing list management

end content of whatever tab is open now

Definition at line 1007 of file roomops.c.

References bstr(), display_main_menu(), display_whok(), escputs(), extract_int(), extract_token(), floorlist, is_https, load_floorlist(), num_tokens(), output_headers(), remove_token(), self_service(), serv_getln(), serv_puts(), urlescputs(), wDumpContent(), and wprintf().

Referenced by do_invt_kick(), editroom(), netedit(), session_loop(), set_room_policy(), and toggle_self_service().

void display_entroom ( void   ) 

display the form for entering a new room

Our clever little snippet of JavaScript automatically selects a public room if the view is set to Bulletin Board or wiki, and it selects a mailbox room otherwise. The user can override this, of course. We also disable the floor selector for mailboxes.

Definition at line 2020 of file roomops.c.

References display_main_menu(), escputs(), floorlist, fmout(), is_view_allowed_as_default(), load_floorlist(), output_headers(), serv_getln(), serv_printf(), serv_puts(), viewdefs, wDumpContent(), and wprintf().

Referenced by session_loop().

void zap ( void   ) 

zap a room

If the forget-room routine fails for any reason, we fall back to the current room; otherwise, we go to the Lobby

Definition at line 2364 of file roomops.c.

References bstr(), serv_getln(), serv_printf(), serv_puts(), and smart_goto().

Referenced by session_loop().

void netedit ( void   ) 

Perform changes to a room's network configuration.

This loop works for add *or* remove. Spiffy, eh?

Definition at line 2414 of file roomops.c.

References bstr(), display_editroom(), extract_token(), num_tokens(), serv_getln(), serv_puts(), and striplt().

Referenced by session_loop().

void room_to_folder ( char *  folder,
char *  room,
int  floor,
int  is_mailbox 
)

Convert a room name to a folder-ish-looking name.

Parameters:
folder the folderish name
room the room name
floor the floor name
is_mailbox is it a mailbox?

For mailboxes, just do it straight...

Otherwise, prefix the floor name as a "public folders" moniker

Replace "\" characters with "|" for pseudo-folder-delimiting

Definition at line 2506 of file roomops.c.

References floorlist.

Referenced by list_all_rooms_by_floor().

void do_change_view ( int  newview  ) 

Back end for change_view().

Parameters:
newview set newview???

Definition at line 2539 of file roomops.c.

References serv_getln(), serv_printf(), and smart_goto().

Referenced by change_view(), and entroom().

void do_folder_view ( struct folder fold,
int  max_folders,
int  num_floors 
)

One big expanded tree list view --- like a folder list.

Parameters:
fold the folder to view
max_folders how many folders???
num_floors hom many floors???

BEGIN TREE MENU

include NanoTree

initialize NanoTree

END TREE MENU

Definition at line 2567 of file roomops.c.

References escputs(), extract_token(), num_tokens(), urlescputs(), and wprintf().

Referenced by list_all_rooms_by_floor().

void do_rooms_view ( struct folder fold,
int  max_folders,
int  num_floors 
)

Boxes and rooms and lists ... oh my!

Parameters:
fold the folder to view
max_folders how many folders???
num_floors hom many floors???

Outer table (for columnization)

Begin inner box

End the final inner box

Definition at line 2684 of file roomops.c.

References do_template(), escputs(), extract_token(), num_tokens(), stresc(), svprintf(), urlescputs(), and wprintf().

Referenced by list_all_rooms_by_floor().

void set_floordiv_expanded ( char *  which_floordiv  ) 

print a floor div???

Parameters:
which_floordiv name of the floordiv???

Definition at line 2783 of file roomops.c.

References begin_ajax_response(), end_ajax_response(), and safestrncpy().

Referenced by session_loop().

void do_iconbar_view ( struct folder fold,
int  max_folders,
int  num_floors 
)

view the iconbar

Parameters:
fold the folder to view
max_folders how many folders???
num_floors hom many floors???

End inner box

floordiv

Begin floor

choose the icon

roomdiv

floordiv

BEGIN: The old invisible pixel trick, to get our JavaScript to initialize

END: The old invisible pixel trick, to get our JavaScript to initialize

Definition at line 2795 of file roomops.c.

References escputs(), extract_token(), jsescputs(), num_tokens(), stresc(), urlescputs(), and wprintf().

Referenced by list_all_rooms_by_floor().

void list_all_rooms_by_floor ( char *  viewpref  ) 

Show the room list. (only should get called by knrooms() because that's where output_headers() is called from).

Parameters:
viewpref the view preferences???

add an extra one for private folders

If our cached folder list is very old, burn it.

Can we do the iconbar roomlist from cache?

Grab the floor table so we know how to build the list...

Start with the mailboxes

Then add floors

refresh the messages index for this room

Now add rooms

Bubble-sort the folder list

Definition at line 2936 of file roomops.c.

References do_folder_view(), do_iconbar_view(), do_rooms_view(), escputs(), extract_int(), extract_token(), folder::floor, folder::hasnewmsgs, folder::is_mailbox, load_floorlist(), folder::name, folder::room, room_to_folder(), folder::selectable, serv_getln(), serv_puts(), folder::view, and wprintf().

Referenced by do_iconbar_roomlist(), and knrooms().

void knrooms ( void   ) 

Do either a known rooms list or a folders list, depending on the user's preference.

Determine whether the user is trying to change views

title bar

offer the ability to switch views

Display the room list in the user's preferred format

Definition at line 3076 of file roomops.c.

References bstr(), get_preference(), list_all_rooms_by_floor(), offer_start_page(), output_headers(), set_preference(), wDumpContent(), and wprintf().

Referenced by session_loop().


Variable Documentation

char floorlist[128][SIZ]

list of our floor names

Definition at line 11 of file roomops.c.

Referenced by display_editroom(), display_entroom(), load_floorlist(), and room_to_folder().

char* viewdefs[8]

the different kinds of available views

Definition at line 13 of file roomops.c.

Referenced by display_entroom(), embed_view_o_matic(), and initialize_viewdefs().


Generated on Wed Jun 20 23:13:13 2007 for webcit by  doxygen 1.5.2