Skip to content

Commit e89347d

Browse files
Merge branch 'igniterealtime:main' into main
2 parents 4eaa87c + 6b7de5c commit e89347d

3 files changed

Lines changed: 16 additions & 3 deletions

File tree

changelog.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ <h1>
4444
REST API Plugin Changelog
4545
</h1>
4646

47+
<p><b>1.12.1</b> (to be determined)</p>
48+
<ul>
49+
<li>[<a href="https://github.com/igniterealtime/openfire-restAPI-plugin/issues/213">#213</a>] - Improve setting a subject in a chat room</li>
50+
</ul>
51+
4752
<p><b>1.12.0</b> July 4, 2025</p>
4853
<ul>
4954
<li>Now requires Openfire 5.0.0 or later</li>

plugin.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<description>Allows administration over a RESTful API.</description>
77
<author>Roman Soldatow</author>
88
<version>${project.version}</version>
9-
<date>2025-07-04</date>
9+
<date>2025-10-02</date>
1010
<minServerVersion>5.0.0</minServerVersion>
1111
<adminconsole>
1212
<tab id="tab-server">

src/java/org/jivesoftware/openfire/plugin/rest/controller/MUCRoomController.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022-2023 Ignite Realtime Foundation
2+
* Copyright (c) 2022-2025 Ignite Realtime Foundation
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -438,7 +438,6 @@ private void createRoom(MUCRoomEntity mucRoomEntity, String serviceName, boolean
438438

439439
// Set values
440440
room.setNaturalLanguageName(mucRoomEntity.getNaturalName());
441-
room.setSubject(mucRoomEntity.getSubject());
442441
room.setDescription(mucRoomEntity.getDescription());
443442
room.setPassword(mucRoomEntity.getPassword());
444443
room.setPersistent(mucRoomEntity.isPersistent());
@@ -494,6 +493,15 @@ private void createRoom(MUCRoomEntity mucRoomEntity, String serviceName, boolean
494493
room.saveToDB();
495494
}
496495

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+
497505
log("Syncing room that is being created/updated: " + mucRoomEntity.getRoomName());
498506
service.syncChatRoom(room);
499507

0 commit comments

Comments
 (0)