mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Add include_user_metadata parameter to Database::general_messages()
The C++ wrapper defaults it to true, so the behaviour hasn't changed for existing callers that don't pass a value for the evaluateConditions parameter, i.e. that call GetGeneralMessages(). Since the new parameter comes before evaluateConditions, existing GetGeneralMessages(true) and GetGeneralMessages(false) calls need to be replaced with GetGeneralMessages(true, true) and GetGeneralMessages(true, false) to retain their existing behaviour. The parameter order was chosen to match that of GetPluginMetadata(), at the cost of this backwards incompatibility.
This commit is contained in:
@@ -138,12 +138,16 @@ impl Database {
|
||||
|
||||
pub fn general_messages(
|
||||
&self,
|
||||
include_user_metadata: bool,
|
||||
evaluate_conditions: bool,
|
||||
) -> Result<Vec<Message>, VerboseError> {
|
||||
self.0
|
||||
.read()
|
||||
.map_err(DatabaseLockPoisonError::from)?
|
||||
.general_messages(to_eval_mode(evaluate_conditions))
|
||||
.general_messages(
|
||||
to_merge_mode(include_user_metadata),
|
||||
to_eval_mode(evaluate_conditions),
|
||||
)
|
||||
.map(|v| v.into_iter().map(Into::into).collect())
|
||||
.map_err(Into::into)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user