jonorthwash/phenny — pull request #57 by hgarrereyn (2014-12-18 03:37:57+00:00)
Title: tell/ask alias support

This addresses the google code-in tell/ask alias challenge

# 3 new commands:

.aliasPair nick - this command adds a request to pair the user's nick with
the specified nick. To complete the alias request, call the reverse request
from the other nick. The following would pair the nicks Foo and Bar:

.aliasPair bar
/nick bar
.aliasPair foo

This command works with any number of aliases. To add another alias, simply
pair a nick with a nick already inside the group. For example, to add the
user Oof as an alias, simply call:

.aliasPair Foo
/nick Foo
.aliasPair Oof

This command works even if both nicks to pair are contained in separate alias
groups. It simply, merges both groups as one alias group.

Alias information is saved to a file following the same format as the other db
files but with the extension .alias.db

--

.aliasList - this command simply lists all the current aliases of the user's
nick. Usage:

.aliasList

--

.aliasRemove - this command removes the user's nick from its alias group –if it
is contained in one. For example, if Foo is contained in the following alias group:

Foo, Bar, Oof

Calling:

.aliasRemove

would remove Foo from the group but not disturb Bar or Oof who would still function
as aliases.

# Integration

When a user sends a tell/ask command to any nick contained in an alias group, phenny
will find any active nick in that group and send it to that nick. Also, once a message
is sent to an active nick, it will not be duplicated and sent to the other nicks.

# Safety concerns:

Since .aliasPair requires a two-way connection and proof that the user can access both
nicks, there shouldn't be any problem with users faking nicks. As long as the nicks are
registered it should be fine.

Also, if you accidentally pair with a non-registered nick, .aliasRemove only has access to
the current user's nick (the one writing the command)

--

author Harrison Green
email: HarrisonMichaelGreen@gmail.com