[DONE] Umode to whitelist people who can PM you

Need a module converted from 3.2.x to UnrealIRCd 4? Or looking for a certain module? Ask here.

Moderators: Gottem, Supporters

Post Reply
Gottem
Posts: 133
Joined: Fri Aug 19, 2016 5:26 pm
Location: NL

[DONE] Umode to whitelist people who can PM you

Post by Gottem » Fri Apr 07, 2017 9:17 pm

The module originally started as an idea from PeGaSuS, but we had to make some compromises to make it work well. =]

Sort of a hybrid between umode +D (don't allow private messages at all) and +R (allow registered users only), this module allows you to keep a whitelist of people allowed to send you private messages. =] Their UID is stored so it persists through nickchanges too, but the module only shows you the original whitelisted nick in lists etc.

Usage:
Load the module and set umode +P on yourself (anyone can (un)set the umode). You can't set up a list without it but if you do have one and then unset the umode, it will be kept. Only when you disconnect will it be cleared (so it even persists through rehashes). Also, if you have +P and message someone else, they will automatically be added to the list. If UIDs go stale (relevant user disconnects) the entry will also be removed. Opers can bypass your whitelist though. ;] See below (Syntax) for how2manage da whitelist.

There are also a few configuration directives for netadmins to tweak (Config block).

Config block:

Code: Select all

pmlist {
	noticetarget 1; // Default is 0
	noticedelay 30; // Seconds only, default = 60
};
  • noticetarget => Whether to notice the target instead, if the source is a regged and logged in user
  • noticedelay => How many seconds have to pass before a user will receive another notice
Syntax:
/OPENPM <nick> => Allow messages from the given user (the argument must be an actual, existing nick)
/CLOSEPM <nickmask> => Clear matching entries from your list; supports wildcard matches too (* and ?)
/PMLIST => Display your current whitelist

Examples:
/OPENPM guest8 => Allow guest8 to message you
/OPENPM muhb0i => Allow muhb0i
/CLOSEPM guest* => Remove all entries matching this mask (guest8, guestxxxx, etc)
/CLOSEPM * => Remove all entries (saves you a disconnect lol)

Now this is what happens when a non-whitelisted user tries to message you:
  • For users who haven't logged into services or if noticetarget is set to 0, they will get a notice saying you don't accept private messages from them. It also instructs them to tell you to do /openpm for them, like in a common channel.
  • For users who have logged into services and if noticetarget is set to 1 you will get a single notice asking you to do /openpm (the notice also includes their message).
  • These notices only happen once in a certain time period (based on the config directive noticedelay). After the first one, everything else will be silently discarded until enough time passes.
Get it here.
If you like my modules, pls consider donating (through PayPal) or becoming a monthly Patron ;];]

Post Reply