kameloso.plugins.services.persistence

The Persistence service keeps track of all encountered users, gathering as much information about them as possible, then injects them into IRCEvents when information about them is incomplete.

This means that even if a service only refers to a user by nickname, things like its ident and address will be available to plugins as well, assuming the Persistence service had seen that previously.

It has no commands.

Members

Classes

PersistenceService
class PersistenceService

The Persistence service melds new IRCUsers (from post-processing new IRCEvents) with old records of themselves.

Functions

dropAllPrivileges
void dropAllPrivileges(PersistenceService service, string nickname)

Drop all privileges from a user, in all channels.

establishUserInCache
auto establishUserInCache(PersistenceService service, IRCUser user, string channelName, bool createIfNoneExist, bool foundExisting)

Fetches a user from the cache, creating it first if it doesn't exist by assigning it to the passed user.

initAccountResources
void initAccountResources(PersistenceService service)

Reads, completes and saves the user classification JSON file, creating one if one doesn't exist. Removes any duplicate entries.

initHostmaskResources
void initHostmaskResources(PersistenceService service)

Reads, completes and saves the hostmasks JSON file, creating one if it doesn't exist.

initResources
void initResources(PersistenceService service)

Initialises the service's hostmasks and accounts resources.

onNamesReply
void onNamesReply(PersistenceService service, IRCEvent event)

Catch users in a reply for the request for a NAMES list of all the participants in a channel.

onWelcome
void onWelcome(PersistenceService service, IRCEvent _)

Reloads classifier definitions from disk.

onWhoReply
void onWhoReply(PersistenceService service, IRCEvent event)

Catch users in a reply for the request for a WHO list of all the participants in a channel.

postprocess
auto postprocess(PersistenceService service, IRCEvent event)

Hijacks a reference to a IRCEvent after parsing and fleshes out the IRCEvent.sender and/or IRCEvent.target fields, so that things like account names that are only sent sometimes carry over.

propagateUserAccount
void propagateUserAccount(PersistenceService service, IRCUser user)

Propagate a user's account to all channels and the nickname-account map.

purgeOldCacheEntries
void purgeOldCacheEntries(PersistenceService service, long cacheEntryMaxAgeSeconds)

Walks the channel-user cache and removes entries older than a certain age. Additionally removes channels with no users, and nicknames from the nickname account map that are not found in any channel.

reload
void reload(PersistenceService service)

Reloads the service, rehashing the user array and loading admin/staff/operator/elevated/whitelist/blacklist classifier definitions from disk.

reloadAccountClassifiersFromDisk
void reloadAccountClassifiersFromDisk(PersistenceService service)

Reloads admin/staff/operator/elevated/whitelist/blacklist classifier definitions from disk.

reloadHostmasksFromDisk
void reloadHostmasksFromDisk(PersistenceService service)

Reloads hostmasks definitions from disk.

resolveAccount
void resolveAccount(PersistenceService service, IRCUser user, long time)

Attempts to resolve the account of a user by looking it up in the various related caches.

resolveClass
void resolveClass(PersistenceService service, IRCUser user, string context, long time)

Attempt to resolve a user class, in the context of some channel (or globally if passed an empty string).

updateUser
void updateUser(PersistenceService service, IRCUser user, string context)

Update a user in the cache, melding the new user into the existing one if it exists, or creating it if it doesn't.

Structs

PersistenceSettings
struct PersistenceSettings

Settings for the Persistence service.

See Also

Meta