Package models

Examples of models.InboxMessage


    renderTemplate("api/messageList.json",data);
  }
 
  public static void get(Long id) {
    User current = getCurrentUser();
    InboxMessage message = InboxMessage.getReceived(id, current);
    if(message==null) notFound();
    //if(message.owner.id.longValue() != current.id.longValue()) forbidden();
    if(!message.readed) {
      message.readed = Boolean.TRUE;
      message.update();
    }
    renderTemplate("api/message.json",message);
  }
View Full Code Here


    renderTemplate("api/message.json",message);
  }
 
  public static void delete(Long id) {
    User current = getCurrentUser();
    InboxMessage message = InboxMessage.getReceived(id, current);
    if(message==null) notFound();
    //if(message.owner.id.longValue() != current.id.longValue()) forbidden();
    message.delete();
  }
View Full Code Here

    message.delete();
  }
 
  public static void edit(Long id, JsonObject body) {
    User current = getCurrentUser();
    InboxMessage message = InboxMessage.getReceived(id, current);
    //Message msgJSON = gson().fromJson(body, Message.class);
    if(message==null) notFound();
    //if(message.id != msgJSON.id) notFound();
    //if(message.to.id.longValue() != current.id.longValue()) forbidden();
    // Copy updateable properties from the JSON object to the original.
    message.readed = body.get("readed").getAsBoolean();
    message.update();
    response.status = StatusCode.OK;
    Map map = new HashMap();
    map.put("id", message.id);
    String url = Router.reverse("api.Subscribers.get", map).url;// GET /clients/1541
    response.setHeader("location", url);
View Full Code Here

   
       
    //Se inserta un mensaje que pertenece al receptor
     
    for(User receiver : receivers)  {
      InboxMessage inbox = new InboxMessage(receiver, message);
      inbox.save();
     
       Tag sharedTag = Tag.findOrCreateByName("shared", receiver);
        for(SharedContent sharedContent : sharedContents) {
          if(Content.ContentType.PHOTO == sharedContent.type) {
            ContentTag contentTag = new ContentTag(sharedContent.id, Content.ContentType.PHOTO, sharedTag);
View Full Code Here

TOP

Related Classes of models.InboxMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.