Commit 775a324f by Lee Munkyeong

未読数ロジック修正

parent 63c4319e
...@@ -146,7 +146,7 @@ public interface ABookCommConstants { ...@@ -146,7 +146,7 @@ public interface ABookCommConstants {
interface SIZE { interface SIZE {
Integer MAX_FAVORITE_COUNT = 100; 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/"; String FILE_SAVE_PATH = "/data/user/0/jp.co.agentec.abookplus.check/files/";
......
...@@ -209,8 +209,9 @@ public class ChatMessageDao extends AbstractCommunicationDao { ...@@ -209,8 +209,9 @@ public class ChatMessageDao extends AbstractCommunicationDao {
return count > 0; return count > 0;
} }
public void updatUnreadCount(List<ChatMessageDto> messageDtoList) { public void updatUnreadCount(List<ChatMessageDto> messageDtoList, String roomId) {
beginTransaction(); beginTransaction();
update("update t_chat_message set unread_count = 0 where chat_room_id=?", new String[]{"" + roomId});
for (ChatMessageDto messageDto : messageDtoList) { for (ChatMessageDto messageDto : messageDtoList) {
update("update t_chat_message set unread_count = ? where chat_message_id=?", new String[]{"" + messageDto.unreadCount, "" + messageDto.chatMessageId}); 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 { ...@@ -1119,7 +1119,7 @@ public class CommunicationLogic extends AbstractLogic {
return map; return map;
} }
public void updateUnreadCount(List<ChatMessageDto> messageList) { public void updateUnreadCount(List<ChatMessageDto> messageList, String roomId) {
chatMessageDao.updatUnreadCount(messageList); chatMessageDao.updatUnreadCount(messageList, roomId);
} }
} }
...@@ -2010,7 +2010,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -2010,7 +2010,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
public void updateUnreadCount() throws NetworkDisconnectedException, AcmsException { public void updateUnreadCount() throws NetworkDisconnectedException, AcmsException {
UnreadCountJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).getMessagesUnreadCount(sid, Integer.toString(roomId.intValue())); 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 { 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