Issue Details (XML | Word | Printable)

Key: MDL-10107
Type: Improvement Improvement
Status: Open Open
Priority: Minor Minor
Assignee: Luis Rodrigues
Reporter: Luis Rodrigues
Votes: 1
Watchers: 11
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

META: New Messaging System (GSoC)

Created: 13/Jun/07 05:13 AM   Updated: 02/May/09 12:22 AM
Component/s: Messages
Affects Version/s: 1.9
Fix Version/s: 2.0

File Attachments: 1. Text File version1.diff (46 kB)
2. Text File version2.diff (81 kB)
3. Text File version3.diff (82 kB)

Issue Links:
Blockers
 
Dependency
 

URL: http://docs.moodle.org/en/Student_projects/Messaging_improvements
Participants: Anthony Borrow, Bryce Thornton, Eloy Lafuente (stronk7), Jason Hardin, Luis Rodrigues, Marc Grober, Martin Dougiamas and Matt Gibson
Security Level: None
Affected Branches: MOODLE_19_STABLE
Fixed Branches: MOODLE_20_STABLE

Sub-Tasks  All   Open   
 Sub-Task Progress: 

 Description  « Hide
Google SoC messaging system improvements.

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Luis Rodrigues added a comment - 19/Jun/07 11:08 PM
This is the first version of changes I've made to create the new message system.

Anthony Borrow added a comment - 10/Jul/07 06:38 AM
Luis - I know that messaging is a popular feature among our students (and faculty). The work on improving messaging is thus very exciting. Thank you for your efforts and for participating in the GSoC. In the documentation it states: "As a teacher, you want to send different messages at the same time to many students. There should be an option, where teacher selects many individual student or a group of students or the entire class, types in the individual messages next to the student name, and does a one click send to all". In order to do this, it would be nice if there were a similar/consistent interface similar to what we have for the participant list whereby a teacher can select the students and then send a bulk message. The two obvious places (just because I use these activities the most) is the \mod\assignment\submissions.php page and the mod\quiz\attempts.php page. Will this be "fixable" under this tracker issue or should I create separate issues for the assignment and quiz modules? Peace - Anthony

Bryce Thornton added a comment - 19/Jul/07 10:30 PM
This is Martin's comment regarding the inclusion of this work in Moodle 1.9 (taken from http://moodle.org/mod/forum/discuss.php?d=76255):

Yes, the move to using Events to pipe all mail through one system and the ability to decide how to redirect messages based on plugins will almost certainly be in 1.9. The new YUI-based interface may not, we'll see.


Matt Gibson added a comment - 14/Sep/07 07:00 AM
What's the status of this? Is any code in a usable state?

Luis Rodrigues added a comment - 14/Sep/07 08:12 AM
There is a new message brocker and new message/chat window in YUI.

I'm waiting for Martin to merge it.


Matt Gibson added a comment - 14/Sep/07 06:17 PM
Great! Thanks for all your work on this. Are there patches/zip files available, or is it impossible to use the new system until Martin does further work to integrate it?

Luis Rodrigues added a comment - 15/Sep/07 01:00 AM
It's not impossible but it would be a lot of work.

Just wait a couple of weeks


Martin Dougiamas added a comment - 08/May/08 03:44 PM
Note: this code is all available here: http://cvs.moodle.org/contrib/patches/messaging_v2/

Work continues on getting it into Moodle core in 2008: http://docs.moodle.org/en/Development:Messaging_2.0


Martin Dougiamas added a comment - 24/Jul/08 04:38 PM
This code is now HEAD. There's more reviewing and polishing to do yet, but it'll be faster now!

Eloy Lafuente (stronk7) added a comment - 25/Jul/08 12:56 AM
Huge patch! Looks promising! B-)

Two comments that come to my mind while looking:

1) Is supposed that each user is going to be able to specify:

a) one preferred notification method for the whole moodle server.
b) more than one (simultaneous) notification methods for the whole moodle server.
c) one preferred notification method for each communication facility (forum posts, messaging, alert emails...)
d) more than one (simultaneous) notification methods for each communication facility

Obviously the more complete is d) where each user can say how he wants to be notified for each facility. mail for forum posts, jabber for messaging, sms for grades... all them supporting multiples (jabber and sms for grades).

2) The "jabberclass" library... could it go to /lib ? I can imagine other parts of moodle being able to communicate with jabber server... say chat module (new type of, like the daemon one) or so.

Ciao


Luis Rodrigues added a comment - 26/Jul/08 12:02 AM
Hello,

1)
a-ok I'm redoing the user messaging preferences form to make it simpler. This will be considered
b-that already exists, the user may specify with processor he/she wants to use
c-all the communication methods register as providers, the user then chooses the type notification per provider
d-also done

2) I still need to think about the best way to use the jabber class since, now for each message it needs to connect and login to the server (the connection should be at least cached)

Tx for the comments


Martin Dougiamas added a comment - 29/Jul/08 12:01 PM - edited
After more looking at this, there's some more basic stuff we need to do, sorry.

1) We need to support more types of messages, more than one per module. So I think we need to change the message_providers table to have:
id, name, component, capability
The capability lets us restrict display of certain message types to certain people (eg some will be for admins only), it'll be checked at system level. We can derive the proper string name from these the same way capabilities do (see get_capability_string), by looking in the component language file for a string derived from the name. eg look in forum.php for "message:posts" and "message:digests"

2) The use of events to register/unregister the providers has turned out to be a bad idea, since they are not really events. Also in the lib/db/install.php there is a hardcoded insert into the database which there should not be. So we need to remove those forum_install() type functions and the hardcoded data in lib/db, and instead we should move to using db/messages.php files, which look very similar to lib/db/access.php and lib/db/events.php files and work the same way. This way it'll be easy to add/remove message types at any time.

eg in lib/db/messages.php

$messages = array (
'moodle:system' => array (
'capability' => 'moodle/site:config'
),

'moodle:errors' => array (
'capability' => 'moodle/site:config'
)
);

and mod/forum/db/messages.php

$messages = array (
'mod/forum:posts' => array (),

'mod/forum:digests' => array()
);


Martin Dougiamas added a comment - 29/Jul/08 05:21 PM
I'm actually working on this right now...

Martin Dougiamas added a comment - 31/Jul/08 04:03 PM
OK, I've checked in these changes, as described above. The only difference is that the names don't contain the full path any more.

eg http://cvs.moodle.org/moodle/mod/forum/db/messages.php

Luiz, can you now complete the other modules in the same way? Note that the objects passed to events_trigger need to contain these two parameters for component and name:

$eventdata = new object();
$eventdata->component = 'mod/forum';
$eventdata->name = 'digests';
$eventdata->userfrom = $site->shortname;
$eventdata->userto = $userto;
$eventdata->subject = $postsubject;
$eventdata->fullmessage = $posttext;
$eventdata->fullmessageformat = FORMAT_PLAIN;
$eventdata->fullmessagehtml = $posthtml;
$eventdata->smallmessage = '';


Martin Dougiamas added a comment - 31/Jul/08 04:15 PM
Can you also keep working on message/edit.php and message/edit_form.php ? .... the variables are not named exactly right yet and need to be fixed.

Luis Rodrigues added a comment - 02/Aug/08 07:59 AM
Working on completing them and on new edit_form.

Luis Rodrigues added a comment - 03/Aug/08 09:06 AM
Martin I just uploaded a mockup for edit. Please check and tell me what you think.

It's on message/edit2.php


Jason Hardin added a comment - 13/Jan/09 08:08 AM
Is this moving forward at all? Moodlerooms would liek to consider implementing this in Moodle .19 and then adding it to 2.0 as well.

Martin Dougiamas added a comment - 13/Jan/09 03:46 PM - edited
Jason, can you be explicit about which part are you referring to? The basic messaging API is all there in 2.0 already.

I wouldn't think this would be easy to port to 1.9 (and due to restrictions on what we can add in the core stable branch, it couldn't go in 1.9.x anyway).


Martin Dougiamas added a comment - 13/Jan/09 03:58 PM
By the way, there is documentation for developers here: http://docs.moodle.org/en/Development:Messaging_2.0

Jason Hardin added a comment - 13/Jan/09 04:18 PM
Specifically we were looking at the core functionality to add a notification event, either email or sms message, and then also the functionality to create notification forms within a block or module. We have several corporate clients that want to use this functionality in Moodle now.

It is disappointing that we will have to create something to satisfy the need now and then rewrite it to work once 2.0 is released and our clients are willing to migrate to it. Thank you for the update I look forward to adding notifications to our blocks and modules once 2.0 is released, it looks to be well designed, and I like the multiple communication types.


Marc Grober added a comment - 18/Feb/09 03:20 AM
It is unclear to many (most?) what the Moodle 2 changes encompass. Will Moodle 2 eliminate the existing chatd? Will Moodle 2 include a jabber daemon? If so, will it be ejabberd? WIll Moodle allow the admin to point moodle at any jabber daemon (so that users who already have jabber running do not have to duplicate effort and do not have to replace an existing jabber daemon with some other)? Will a jabber client be included in Moodle 2 and what if any options will there be to substitute other clients? If a jabber client is included will it be multi-protocol capable ( e.g. pidgen/adium or trillian come to mind).