Commit 775a324f by Lee Munkyeong

未読数ロジック修正

parent 63c4319e
......@@ -146,7 +146,7 @@ public interface ABookCommConstants {
interface SIZE {
Integer MAX_FAVORITE_COUNT = 100;
Integer MESSAGE_PAGING_SIZE = 20;
Integer MESSAGE_PAGING_SIZE = 100;
}
String FILE_SAVE_PATH = "/data/user/0/jp.co.agentec.abookplus.check/files/";
......
......@@ -209,8 +209,9 @@ public class ChatMessageDao extends AbstractCommunicationDao {
return count > 0;
}
public void updatUnreadCount(List<ChatMessageDto> messageDtoList) {
public void updatUnreadCount(List<ChatMessageDto> messageDtoList, String roomId) {
beginTransaction();
update("update t_chat_message set unread_count = 0 where chat_room_id=?", new String[]{"" + roomId});
for (ChatMessageDto messageDto : messageDtoList) {
update("update t_chat_message set unread_count = ? where chat_message_id=?", new String[]{"" + messageDto.unreadCount, "" + messageDto.chatMessageId});
}
......
......@@ -1119,7 +1119,7 @@ public class CommunicationLogic extends AbstractLogic {
return map;
}
public void updateUnreadCount(List<ChatMessageDto> messageList) {
chatMessageDao.updatUnreadCount(messageList);
public void updateUnreadCount(List<ChatMessageDto> messageList, String roomId) {
chatMessageDao.updatUnreadCount(messageList, roomId);
}
}
......@@ -2010,7 +2010,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
public void updateUnreadCount() throws NetworkDisconnectedException, AcmsException {
UnreadCountJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).getMessagesUnreadCount(sid, Integer.toString(roomId.intValue()));
communicationLogic.updateUnreadCount(resultJson.chatMessageDtoArrayList);
communicationLogic.updateUnreadCount(resultJson.chatMessageDtoArrayList, Integer.toString(roomId.intValue()));
}
public void updateMessageFromMessageId(String messageId) throws NetworkDisconnectedException, AcmsException {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment