Getting full path name to the specified group (department) from the common tree-like contact list by its numeric identifier.
function mGetDepartmentTextPathByID(iID: integer): string;
Parameter |
Type |
Value |
iID |
integer |
numeric identifier of a group in MyChat Server common contact list. |
Full path from the root. Group names are separated by the backslash symbol ("\"). If the common contact list is empty or group identifier does not exist, the function returns an empty string.
const
iUIN = 6;
var
iUserDeptID: integer;
sPath, sUserDisplayName: string;
begin
iUserDeptID := mGetUserDepartmentID(iUIN);
if iUserDeptID > 0 then begin
sPath := mGetDepartmentTextPathByID(iUserDeptID);
sUserDisplayName := mGetUserAttribute(iUIN, 'DisplayName');
mLogScript('User "' + sUserDisplayName + '" UIN ' + inttostr(iUIN) + ' is in the "' + sPath + '" group of common contacts', '');
end else mLogScript('User "' + sUserDisplayName + '" UIN ' + inttostr(iUIN) + ' isn''t in the common contacts list', '');
end.
[15:26:34] (Log "mGetDepartmentTextPathByID"): User "Alexey Pikurov" UIN 6 is in the "MyChat\Teamleads developers" group of common contacts
[15:26:34] (Run "mGetDepartmentTextPathByID"): Script operation time: 7 ms
[15:26:34] (Run "mGetDepartmentTextPathByID"): Script done successfully.