![]() |
LeechCraft Azoth
%{LEECHCRAFT_VERSION}
Modular multiprotocol IM plugin for LeechCraft
|
This interface describes permissions in the given room. More...
#include "imucperms.h"
Public Member Functions | |
virtual | ~IMUCPerms () |
virtual QMap< QByteArray, QList< QByteArray > > | GetPossiblePerms () const =0 |
Returns all possible permission classes and values. More... | |
virtual QMap< QByteArray, QList< QByteArray > > | GetPerms (QObject *participant) const =0 |
Returns current permissions for the given participant. More... | |
virtual QPair< QByteArray, QByteArray > | GetKickPerm () const =0 |
virtual QPair< QByteArray, QByteArray > | GetBanPerm () const =0 |
virtual QByteArray | GetAffName (QObject *participant) const =0 |
Returns the name of the affiliation icon. More... | |
virtual bool | MayChangePerm (QObject *participant, const QByteArray &permClass, const QByteArray &targetPerm) const =0 |
Whether given participant's permission may be changed to the given value. More... | |
virtual void | SetPerm (QObject *participant, const QByteArray &permClass, const QByteArray &targetPerm, const QString &reason)=0 |
Sets the permission for the given participant. More... | |
virtual bool | IsLessByPerm (QObject *part1, QObject *part2) const =0 |
Returns if one participant has less perms than another. More... | |
virtual bool | IsMultiPerm (const QByteArray &permClass) const =0 |
Returns whether users can have many perms of the given class at once. More... | |
virtual QString | GetUserString (const QByteArray &id) const =0 |
Returns a human-readable string for the given id. More... | |
This interface describes permissions in the given room.
If a room supports getting/changing permissions for participants, this interface should be implemented by the room's CL entry object.
There may be different permission classes in a room, and each permission class has several permission variants, which are exclusive, while permissions from different classes are not exclusive.
For example, an XMPP MUC room has two permission classes: roles and affiliations. Role class and affiliation class have a different set of permissions, like participant/moderator or outcast/member/admin respectively.
Definition at line 58 of file imucperms.h.
|
inlinevirtual |
Definition at line 61 of file imucperms.h.
|
pure virtual |
Returns the name of the affiliation icon.
Returns the name of the icon which is somewhat analogous to XMPP's affiliation system. The plugin is free to choose what participants should have as the affiliation.
The name should be one of the following:
[in] | participant | The participant to query. |
|
pure virtual |
|
pure virtual |
|
pure virtual |
Returns current permissions for the given participant.
The returned map must have the same keys as the one from GetPossiblePerms(), and the values must be contained in the corresponding lists in GetPossiblePerms()'s return value.
[in] | participant | The participant for which to query the permissions, or NULL to query self. |
|
pure virtual |
Returns all possible permission classes and values.
Returns all possible permission classes and values for this MUC. In the map, the key is used as the permission class identifier, while the corresponding list of QByteArrays is the list of permission variants for this class.
Please note that this list should not change between calls to this method.
|
pure virtual |
Returns a human-readable string for the given id.
[in] | id | The identifier to query. |
|
pure virtual |
Returns if one participant has less perms than another.
This method is used for ordering participants when displaying them in MUC's participants list. For example, an XMPP room would typically use participants' roles for ordering.
[in] | part1 | First participant. |
[in] | part2 | Second participant. |
|
pure virtual |
Returns whether users can have many perms of the given class at once.
This function is used to query the whether users in this MUC can have multiple perms of the given permClass at once.
[in] | permClass | The permission class to query. |
|
pure virtual |
Whether given participant's permission may be changed to the given value.
This function is used to query whether at this moment the permission from the given permClass could be set to the targetPerm value by our user.
targetPerm is one of the corresponding values from the map returned from GetPossiblePerms() map.
In case of failure (for example, participant doesn't belong to this room), this function should return false.
[in] | participant | The participant to query. |
[in] | permClass | Permission class to operate in. |
[in] | targetPerm | Target permission in that class. |
|
pure virtual |
Sets the permission for the given participant.
This function is used to set the participant's permission from the given permClass to the given targetPerm value (which is one of returned from GetPossiblePerms() for that class). If applicable, reason is used to describe the reason for changing the permission, which may be extremely useful, for example, when kicking or banning.
[in] | participant | The participant to change the affiliation. |