return newMessageId;
}
@Override
public long forwardShortMessage(long id, long ownerId, String ownerNickname, String ownerPortrait, String comment) {
ShortMessage forwardedMessage = shortMessageDao.queryShortMessage(id);
if (forwardedMessage == null) {
return 0;
} else {
// String source="";
long forwardId = shortMessageDao.insertShortMessage(ownerId, ownerNickname, ownerPortrait, forwardedMessage.getText(), comment,
forwardedMessage.getOwnerId(), forwardedMessage.getOwnerNickname());
if (forwardId != 0) {
String text = forwardedMessage.getText();
if (text.length() > 10) {
text = text.substring(0, 10);
}
commentService.commentResource(ownerId, ownerNickname, ownerPortrait, comment, (long) 0, forwardId, text,
CommentType.SHORTMESSAGE, forwardedMessage.getOwnerId());
String content="";
//if(forwardedMessage.getSourceOwnerId()!=0){
String arch ="<a href='../user/"+forwardedMessage.getSourceOwnerId()+".html'>"+forwardedMessage.getOwnerNickname()+"</a>";
content=comment+" 转自"+arch+"<br>";
content+="<div class='shortMessageContent'>"+arch+":"+forwardedMessage.getText()+"</div>";
//content=
// }
personalFeedService.addFeed(forwardId, "短消息", content, ownerId, ownerNickname, ownerPortrait, ownerId, FeedType.SHORTMESSAGE);
}
return forwardId;