[Building Sakai] comment notification in clog tool

Mustansar Mehmood mustansar at rice.edu
Mon Apr 15 13:32:57 PDT 2013


Hi,
      It seems that no matter who comments on a post, email notification 
for the comment appears as if the comment was made by the post creator. 
After looking into the code I noticed this method responsible for the 
generation of the email  body.

protected String plainTextContent(Event event) {
         Reference ref = EntityManager.newReference(event.getResource());
         Post post = (Post) ref.getEntity();

         String creatorName = "";
         try {
             creatorName = 
UserDirectoryService.getUser(post.getCreatorId()).getDisplayName();
         } catch (UserNotDefinedException e) {
             e.printStackTrace();
         }

         return rb.getFormattedMessage("noti.body", new 
Object[]{creatorName,post.getTitle(),post.getUrl()});
     }

This lines implies that creater of the post will (falsely)appear as the 
commenter as well.
   creatorName = 
UserDirectoryService.getUser(post.getCreatorId()).getDisplayName();

I am not 100% sure if I have stumbled upon a bug here. Comments?

Thanks,
Mustansar

-- 
Mustansar Mehmood
Educational System Developer& Integrator

Information Technology
6100 Main St. MS 119
Houston Texas 77005

Phone:(713)348-2523
Fax  :(713)348 6099
email:mustansar at rice.edu





I have yet to see any problem, however complicated, which, when,you  looked at it in the right way, did not become still more complicated.
     -- Poul Anderson

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20130415/ca9d6717/attachment.html 


More information about the sakai-dev mailing list