Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OF-2918 Clear MUC Chat History #2627

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e8ac57a
OF-2918: Add option to clear history for a given MUC
Nov 29, 2024
2df54ce
OF-2918: Add option to clear history for a given MUC
Nov 29, 2024
4afca51
OF-2918: Add option to clear history for a given MUC
Nov 29, 2024
7bd86d3
OF-2918: Add option to clear history for a given MUC
Nov 29, 2024
196e6ee
OF-2918: Add option to clear history for a given MUC
Nov 29, 2024
f8343f6
OF-2918: Add option to clear history for a given MUC
Nov 29, 2024
5f3573a
OF-2918: Add option to clear history for a given MUC
Dec 3, 2024
156f9ce
OF-2918: Add option to clear history for a given MUC
Dec 3, 2024
01af2dd
OF-2918: Add option to clear history for a given MUC
Dec 3, 2024
d5a9754
OF-2918: Add option to clear history for a given MUC
Dec 6, 2024
7be30bd
OF-2918: Add option to clear history for a given MUC
Dec 6, 2024
94f083d
OF-2918: Add option to clear history for a given MUC
Dec 6, 2024
4e83456
OF-2918: Add option to clear history for a given MUC
Dec 6, 2024
4ed359c
OF-2918: Add option to clear history for a given MUC
Dec 6, 2024
5d673d2
#369 and #370 Clear Chat Room History
Dec 11, 2024
4ae3b94
#369 and #370 Clear Chat Room History
Dec 11, 2024
82fc000
#369 and #370 Clear Chat Room History
Dec 11, 2024
b7f21ae
#369 and #370 Clear Chat Room History
Dec 11, 2024
c03e7e0
#369 and #370 Clear Chat Room History
Dec 11, 2024
db1bc7d
OF-2918: Add option to clear history for a given MUC
Dec 12, 2024
2e8dabf
OF-2918: Add option to clear history for a given MUC
Dec 16, 2024
9de6408
OF-2918: Add option to clear history for a given MUC
Dec 16, 2024
79f01f0
OF-2918: Add option to clear history for a given MUC
Dec 16, 2024
2c0f292
OF-2918: Add option to clear history for a given MUC
Dec 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,45 @@ public class SequenceManager {
}

private static final Cache<Integer, Data> sequenceBlocks = CacheFactory.createCache("Sequences");
private static final Map<String, Integer> uniqueNameToType = new ConcurrentHashMap<>();

/**
* Returns a SequenceManager instance for a given unique name with a default block size of 5.
* If a SequenceManager for the unique name already exists, it returns the existing instance.
* Otherwise, it creates a new SequenceManager with a unique type and the default block size.
*
* @param uniqueName the unique name for which to get the SequenceManager.
* @return the SequenceManager instance associated with the unique name.
*/
public static SequenceManager getSequenceManagerByUniqueName(String uniqueName) {
return getSequenceManagerByUniqueName(uniqueName, 5);
}

/**
* Returns a SequenceManager instance for a given unique name. If a SequenceManager
* for the unique name already exists, it returns the existing instance. Otherwise,
* it creates a new SequenceManager with a unique type and the specified size.
*
* @param uniqueName the unique name for which to get the SequenceManager.
* @param size the block size for the SequenceManager if a new one is created.
* @return the SequenceManager instance associated with the unique name.
*/
public static SequenceManager getSequenceManagerByUniqueName(String uniqueName, int size) {
// Return an existing SequenceManager if one exists for the unique name.
if (uniqueNameToType.containsKey(uniqueName)) {
return managers.get(uniqueNameToType.get(uniqueName));
}

// Otherwise, create a new SequenceManager for the unique name.
int type = 1;
while (true) {
if (!managers.containsKey(type)) {
uniqueNameToType.put(uniqueName, type);
return new SequenceManager(type, size);
}
type++;
}
}
guusdk marked this conversation as resolved.
Show resolved Hide resolved

/**
* Returns the next ID of the specified type.
Expand Down
Loading