collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18363
  • stats Total Topics: 2500
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: modules/Mail.php  (Read 19855 times)

0 Members and 2 Guests are viewing this topic.

Offline Blueeagle

  • Omnipotent
  • BeBot Hero
  • ******
  • Posts: 323
  • Karma: +0/-0
modules/Mail.php
« on: March 04, 2007, 03:39:39 pm »
I've been working on a bot mail system that allows members and guests to send offline messages to eachother. This is a huge improvement over offline tells.

Features:
 - All registered alts of a player has got access to the same mailbox.
 - Configurable with the new settings module to allow different levels of access to send and read mail. (IE it can be restricted so only leaders/admins may send mail and everyone may read mail sendt or only leaders can read mail but everyone can send mail to them or all but guests can send/recieve and so on)
- Configurable expiration time of read and unread mail
- Conigurable (global) notificaton of unread mail when a player logs on any of his alts

To do: (ignore the to-do list in the Mail.php file.
 - Cron jobs got lost in a brainfart. Needs to be re-implemented.
 - Colors of message windows needs to be ported to the new Colors module
 - Implement a mass messaging feature so that leaders (configurable ofcourse) can send messages to everyone of a certain access level. (Not sure how this should be done. Ideas are welcome)
 - For those running a webserver on the same machine as the bot it would be possible to implement a web-based send mail interface that iterfaces directly with the database. Not sure how to best make such an interface to be implementable by various boards used by guilds tho.
 - Testing, testing and more testing

Please give feedback.

Attatchment: modules/Mail.php

Edit: Added more stuff to the TO-DO list
« Last Edit: March 04, 2007, 03:57:05 pm by Blueeagle »
The only problem that can't be solved by adding another wrapper is having too many wrappers.

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: modules/Mail.php
« Reply #1 on: March 04, 2007, 04:11:51 pm »
Nice idea!

For more info on colors check the wiki

Offline Blueeagle

  • Omnipotent
  • BeBot Hero
  • ******
  • Posts: 323
  • Karma: +0/-0
Re: modules/Mail.php
« Reply #2 on: March 04, 2007, 05:01:30 pm »
Nice idea!

For more info on colors check the wiki

Yeah, I saw that. I had it all set up but I lost it when I was updating the svn tree. :p
The only problem that can't be solved by adding another wrapper is having too many wrappers.

Offline Malosar

  • BeBot Expert
  • ****
  • Posts: 259
  • Karma: +0/-0
    • http://www.lowerdimension.com
Re: modules/Mail.php
« Reply #3 on: March 04, 2007, 06:22:50 pm »
Thats a really good idea, mind if I help out?
Eternalist
General of The Syndicate

Offline Wolfbiter

  • Contributor
  • *******
  • Posts: 149
  • Karma: +0/-0
    • KAZE
Re: modules/Mail.php
« Reply #4 on: March 04, 2007, 06:28:48 pm »
Always thought about doing this, but never got off my fat ass.
Good job.
Too many toons.

Offline Wolfbiter

  • Contributor
  • *******
  • Posts: 149
  • Karma: +0/-0
    • KAZE
Re: modules/Mail.php
« Reply #5 on: March 04, 2007, 06:41:45 pm »
Well.. here goes my check of the script...

Code: [Select]
Line 186: $mailbox=$this->bot->alts->main($user);
Line 187: $no_of_messages=$this->new_mail_count($name);
I assume it's supposed to use main for mail, but it still checks mail for $name instead of $mailbox.

Maybe make the logon notify a user setting instead of a script setting? Since some people might want to be notified and others doesn't.
For when you add cron, maybe go over buddylist and see if anyone has any unread mail still?
You should remove all commented things that isn't yours (like all the stuff from the template you don't use).
Too many toons.

Offline Blueeagle

  • Omnipotent
  • BeBot Hero
  • ******
  • Posts: 323
  • Karma: +0/-0
Re: modules/Mail.php
« Reply #6 on: March 04, 2007, 07:47:38 pm »
Thats a really good idea, mind if I help out?

Thank you and no, go right a head. :)

Edit: Khalem talked something about setting up a dev branch. Now I don't know how to do that but it might be a good idea if several people are to be working on this.
« Last Edit: March 04, 2007, 07:49:32 pm by Blueeagle »
The only problem that can't be solved by adding another wrapper is having too many wrappers.

Offline Blueeagle

  • Omnipotent
  • BeBot Hero
  • ******
  • Posts: 323
  • Karma: +0/-0
Re: modules/Mail.php
« Reply #7 on: March 04, 2007, 07:48:34 pm »
Well.. here goes my check of the script...

Code: [Select]
Line 186: $mailbox=$this->bot->alts->main($user);
Line 187: $no_of_messages=$this->new_mail_count($name);
I assume it's supposed to use main for mail, but it still checks mail for $name instead of $mailbox.

Maybe make the logon notify a user setting instead of a script setting? Since some people might want to be notified and others doesn't.
For when you add cron, maybe go over buddylist and see if anyone has any unread mail still?
You should remove all commented things that isn't yours (like all the stuff from the template you don't use).

Yeah I think I missed some notifies. This probably explains it. Thank you.
The only problem that can't be solved by adding another wrapper is having too many wrappers.

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: modules/Mail.php
« Reply #8 on: March 29, 2007, 12:29:56 pm »
Some errors I caught:
  • in mail_send() you have checks to escape the string and replace some stuff. It's working on $mail_message instead of $message though, or the variable in the INSERT should be $mail_message.
  • if($settings['Logon_notificaton']=TRUE) in buddy() will always be true ;)
  • if(msg===1) in buddy() got one = too many
  • I've had to adapt the settings names to the ucfirst(strtolower()) format now used in SVN (I guess you posted the module before I made the change in SVN).

As I don't like spam right on logon I've added a slight delay to the notifies. And I've added default access levels for the commands.

Here is my modified version with the fixes/adds.

PS: forgot to add: if you aren't allowed to send mail it just returns an empty tell. Missing some return value there.

Offline Blueeagle

  • Omnipotent
  • BeBot Hero
  • ******
  • Posts: 323
  • Karma: +0/-0
Re: modules/Mail.php
« Reply #9 on: March 29, 2007, 10:02:51 pm »
Good job mate!

Just to find something to pick on:
  • if(msg===1) in buddy() got one = too many

= assings
== checks for equality
=== checks for identicality

if (1 ==  "1") is true while
if (1 === "1") is false because 1 is an integer while "1" is a string

A moot point since the variable type is irellevant in this case. :)
The only problem that can't be solved by adding another wrapper is having too many wrappers.

Offline Malosar

  • BeBot Expert
  • ****
  • Posts: 259
  • Karma: +0/-0
    • http://www.lowerdimension.com
Re: modules/Mail.php
« Reply #10 on: March 29, 2007, 10:51:41 pm »
hehe, you said assings  ;D

(sorry, had to do it)
Eternalist
General of The Syndicate

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: modules/Mail.php
« Reply #11 on: March 29, 2007, 11:20:40 pm »
= assings
== checks for equality
=== checks for identicality

if (1 ==  "1") is true while
if (1 === "1") is false because 1 is an integer while "1" is a string

A moot point since the variable type is irellevant in this case. :)
Didn't know that yet, nice to learn that.

Offline Blueeagle

  • Omnipotent
  • BeBot Hero
  • ******
  • Posts: 323
  • Karma: +0/-0
Re: modules/Mail.php
« Reply #12 on: March 29, 2007, 11:51:36 pm »
hehe, you said assings  ;D

(sorry, had to do it)

Aw poo! ;)
The only problem that can't be solved by adding another wrapper is having too many wrappers.

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: modules/Mail.php
« Reply #13 on: March 30, 2007, 12:41:33 pm »
Why did you add the make_item_blob() function btw? Not sure what's it supposed to archieve, and it's crashing my AORC :P

Offline Blueeagle

  • Omnipotent
  • BeBot Hero
  • ******
  • Posts: 323
  • Karma: +0/-0
Re: modules/Mail.php
« Reply #14 on: March 30, 2007, 03:19:14 pm »
Because itemrefs sendt trough make_blob were rendered useless.
The only problem that can't be solved by adding another wrapper is having too many wrappers.

 

* Recent Posts
[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm]


0.8.x updates for AoC by bitnykk
[January 30, 2024, 11:16:08 pm]


0.8.x updates for AO by bitnykk
[January 30, 2024, 11:15:37 pm]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am]


Bebot and Rasberry by bitnykk
[November 29, 2023, 11:04:14 pm]

* Who's Online
  • Dot Guests: 442
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal