You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fixesigniterealtime#146: Add option to choose between database used for MUC archive
The archived MUC messages are persisted to the database more than once: Openfire stores them in ofMucConversationLog, the Monitoring plugin in ofMessageArchive.
This commit introduces a configuration option to switch between the two: conversation.database.use-openfire-tables
The default for this new option is to use the database table provided by the Monitoring plugin, which is a change from the behavior prior to this commit.
<li>[<ahref='https://github.com/igniterealtime/openfire-monitoring-plugin/issues/141'>Issue #141</a>] - Make Archiver configuration configurable</li>
55
+
<li>[<ahref='https://github.com/igniterealtime/openfire-monitoring-plugin/issues/142'>Issue #142</a>] - Do not require plugin restart after config change</li>
56
+
<li>[<ahref='https://github.com/igniterealtime/openfire-monitoring-plugin/issues/145'>Issue #145</a>] - Replace deprecated API usage</li>
57
+
<li>[<ahref='https://github.com/igniterealtime/openfire-monitoring-plugin/issues/146'>Issue #146</a>] - Allow database used for MUC MAM to be configurable</li>
@@ -106,11 +134,14 @@ protected List<ArchivedMessage> getPage( final Long after, final Long before, fi
106
134
pstmt = connection.prepareStatement( query );
107
135
pstmt.setLong( 1, dateToMillis( startDate ) );
108
136
pstmt.setLong( 2, dateToMillis( endDate ) );
137
+
138
+
// TODO Optimize this for the MUC use-case. Unlike personal archives, the owner of the MUC archive is guaranteed to be in the 'tojid' column. For MUC, there's no need to look in both columns.
109
139
pstmt.setString( 3, owner.toBareJID() );
110
140
pstmt.setString( 4, owner.toBareJID() );
111
141
intpos = 4;
112
142
113
143
if ( with != null ) {
144
+
// TODO Optimize this for the MUC use-case. Unlike personal archives, the relevant 'with' value (sender of the message) of the MUC archive is guaranteed to be in the 'fromJid' columns. For MUC, there's no need to look in both columns.
114
145
if (with.getResource() == null) {
115
146
pstmt.setString( ++pos, with.toString() );
116
147
pstmt.setString( ++pos, with.toString() );
@@ -147,11 +178,7 @@ protected List<ArchivedMessage> getPage( final Long after, final Long before, fi
0 commit comments