add_feature_by_type


Description:

public void add_feature_by_type (Type feature_type)

If feature_type is the type of a class that implements [iface@SessionFeature], this creates a new feature of that type and adds it to this as with [method@Session.

add_feature]. You can use this when you don't need to customize the new feature in any way. Adding multiple features of the same feature_type is not allowed.

If feature_type is not a [iface@SessionFeature] type, this gives each existing feature on this the chance to accept feature_type as a "subfeature". This can be used to add new [class@Auth] types, for instance.

See the main Session documentation for information on what features are present in sessions by default.

Parameters:

this

a Session

feature_type

a Type




2022 vala-language.org