|
1 | 1 | /* |
2 | | - * Copyright (c) 2022-2023 Ignite Realtime Foundation |
| 2 | + * Copyright (c) 2022-2025 Ignite Realtime Foundation |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
@@ -438,7 +438,6 @@ private void createRoom(MUCRoomEntity mucRoomEntity, String serviceName, boolean |
438 | 438 |
|
439 | 439 | // Set values |
440 | 440 | room.setNaturalLanguageName(mucRoomEntity.getNaturalName()); |
441 | | - room.setSubject(mucRoomEntity.getSubject()); |
442 | 441 | room.setDescription(mucRoomEntity.getDescription()); |
443 | 442 | room.setPassword(mucRoomEntity.getPassword()); |
444 | 443 | room.setPersistent(mucRoomEntity.isPersistent()); |
@@ -494,6 +493,15 @@ private void createRoom(MUCRoomEntity mucRoomEntity, String serviceName, boolean |
494 | 493 | room.saveToDB(); |
495 | 494 | } |
496 | 495 |
|
| 496 | + // Set the subject (see issue #213 and OF-3131). |
| 497 | + final Message message = new Message(); |
| 498 | + message.setType(Message.Type.groupchat); |
| 499 | + message.setSubject(mucRoomEntity.getSubject()); |
| 500 | + message.setFrom(room.getSelfRepresentation().getOccupantJID()); |
| 501 | + message.setTo(room.getSelfRepresentation().getOccupantJID()); |
| 502 | + log("Setting subject of room that is being created/updated: " + mucRoomEntity.getRoomName()); |
| 503 | + room.changeSubject(message, room.getSelfRepresentation()); |
| 504 | + |
497 | 505 | log("Syncing room that is being created/updated: " + mucRoomEntity.getRoomName()); |
498 | 506 | service.syncChatRoom(room); |
499 | 507 |
|
|
0 commit comments