lynnfaraday / MUSH

MUSH Softcode and Utilities
8 stars 1 forks source link

Set wizard flag on mail_object attribute #56

Closed sceox closed 10 years ago

sceox commented 10 years ago

A player can read another player's mail (if they have that player's mail object dbref) by setting &mail_object me=<dbref> then running +mail as usual. Adding [set(%#/mail_object,wizard)] to the mail/init routine fixes this.

I can do a pull request if you want.

lynnfaraday commented 10 years ago

Good catch. The codebase uses the player setup object to regulate attribute protection, so rather than modifying the MAIL_INIT routine to set the attribute flags, the mail system simply needs to define that attribute as protected/hidden.

Changes to the mail system:

  &HATTR_MAIL_OBJECT FaraMail Commands=

  &CMD-+MAIL-INIT FaraMail Commands=$+mail/init:@switch words(xget(%#,mail_object))=1,@pemit %#=<MAIL> Mail already initialized.,{think [setq(0,create(%N Mail,10))][set(%#,mail_object:%q0)][set(%q0,current_folder:0)][set(%q0,foldername_0:Inbox)][set(%q0,sort_method:date)][set(%q0,color:r)][set(%q0,sig:)][set(%q0,describe:%N Mail)][set(%q0,folder_0:)];@chown %q0=*Postmaster;@set %q0=!halt;@tel %q0=#MAIL_OBJECTS}

Be sure to run: +install/updategroup MAIL after changing the mail init command.