[Package Index | Mudlib Index | Effect Index]

File /obj/handlers/mail_track.c

This handler keeps track of who has a mailer at the moment and sends the mail to there instead. This also keeps track of the current mailing lists in the system.

Written by Pinkfish

Started 1991 sometime

Inherits

This class inherits the following classes std/object.c

Includes

This class includes the following files /include/player_handler.h, /include/mail.h, /include/mail_track.h and /include/board.h

Method index

Public Functions

These are functions that everyone can access.

add_controller
int add_controller(string list_name,
                   string mem)

This method adds a controller to the specified mailing list.

Parameters:
list_name - the controller to add
mem - the controller to add

See also:
query_controllers()


add_mailer
int add_mailer(object ob,
               string str)

This method adds in a mailer for a specific player into the current list of mailers.

Parameters:
ob - the mailer for the player
str - the player the mailer is for

Returns:
return 1 if successful


add_member
int add_member(string list_name,
               string mem)

This method adds a member to the specified mailing list.

Parameters:
list_name - the mailing list to add a member too
mem - the member to add

Returns:
1 if successful, 0 if not

See also:
remove_member() and add_member()


create_list
int create_list(string list,
                string creator)

This method attempts to create a mailing list.

Parameters:
list - the name of the list to create
creator - the creator of the list

Returns:
1 if successful, 0 if not

See also:
query_creator(), query_members() and query_controllers()


delete_mailer
int delete_mailer(object ob)

This method removes a mailer from the current list of mailers. It removes the mailer based on the object itself

Parameters:
ob - the mailer object to remove

Returns:
0 if unable to remove

See also:
add_mailer() and find_mailer()


delete_member
int delete_member(string list_name,
                  string mem)

This method removes a member from the list if they are either a controller or a member.

Parameters:
list_name - the list to remove the member from
mem - the member to remove from the list

Returns:
1 on succes, 0 on failure

See also:
remove_member() and remove_controller()


find_mailer
object find_mailer(string str)

This method finds the mailer associated with a particular player.

Parameters:
str - the player whose mailer to find.

Returns:
the mailer object associated with the player

See also:
add_mailer() and delete_mailer()


mail
int mail(string str,
         string sub)

This is the main mail function. It tries to start up a mailer with the default address and subject. If their is no default address then the mailer uses it's menu mode, otherwise it sends one mail and then leaves.

Parameters:
str - 0 or "" for no default address
sub - the default subject


post_mail_to_board
int post_mail_to_board(string target,
                       class mail_message msg)

This posts a mail to a message-board.

Parameters:
target - the name under which the board is registered
msg - the mail to post

Returns:
1 if the message was posted successfully, 0 otherwise


query_board_name
string query_board_name(string name)

This methods returned the actual name of the board that is referenced by the given alias.

Parameters:
name - the alias to resolve

Returns:
the name of the board or 0 on failure


query_controller
int query_controller(string list_name,
                     string name)

This method checks to see if the given player is a controller.

Parameters:
list_name - the name of the list
name - the name to check to see if they are a controller

See also:
query_controllers() and query_member()


query_controllers
string * query_controllers(string list)

This method returns all the current controllers of the mailing list. Controllers can add and remove members from a list.

Parameters:
list - the mailing list to query the controllers for

Returns:
the array of controllers


query_creator
string query_creator(string list_name)

This method determines the creator of the list.

Parameters:
list_name - the list to get the creator of

Returns:
the creator of the list

See also:
create_list()


query_list
int query_list(string list)

This method checks to see if the specified list exists or not.

Parameters:
list - the list name to check

Returns:
1 if the list exists, 0 if not

See also:
query_mailing_lists(), query_members() and query_member()


query_mailing_lists
string * query_mailing_lists()

This method returns the current mailing lists available on the handler.

Returns:
the array of available mailing lists


query_member
int query_member(string list_name,
                 string name)

This method checks to see if the given player is in the selected mailing list.

Parameters:
list_name - the mailing list name
name - the name of the player in the list

Returns:
1 if the player is a member, 0 if not

See also:
query_mailing_lists(), query_list() and query_members()


query_members
string * query_members(string list)

This returns the current members of the specified mailing list.

Parameters:
list - the mailing list to get the memebrs of

Returns:
the members of the mailing list

See also:
query_mailing_lists(), query_list() and query_member()


query_msgboards
string * query_msgboards()

This returns all the registered messageboards.

Returns:
The names of all messageboards.


query_registered_board
int query_registered_board(string name)

This method checks whether the given name is a valid alias for a message-board.

Parameters:
name - the name to check

Returns:
1 if it is a board, 0 otherwise


register_msgboard
int register_msgboard(string alias,
                      string board)

This method is used to register an alias for a messageboard. If there already is another board aliased like this, you have to unregister that alias first.

Parameters:
alias - the string to use as an alias

Returns:
1 on sucess, 0 on failure


remove_controller
int remove_controller(string list_name,
                      string name)

This method removes a controller from the specified mailing list.

Parameters:
list_name - the mailing list to remove the member from
name - the member to remove

See also:
add_controller() and query_controller()


remove_member
int remove_member(string list_name,
                  string mem)

This method removes a member from the specified mailing list.

Parameters:
list_name - the mailing list to remove the member from
mem - the members name to remove

Returns:
1 on success, 0 on failure

See also:
add_member(), query_member() and delete_member()


unregister_msgboard
void unregister_msgboard(string alias)

This method removes an alias for a messageboard.

Parameters:
alias - the alias to be removed


Protected Functions

These are functions that only objects inheriting the class can access.

delete_list
int delete_list(string list)

This method will delete a mailing list.

Parameters:
list - the mailing list to delete

Returns:
0 if failed and 1 on success

See also:
create_list()