Thread Tools Display Modes
02-17-15, 07:57 PM   #1
siweia
A Flamescale Wyrmkin
 
siweia's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2011
Posts: 126
API for Officer channel?

Is there any API that tell someone can use officer channel?

"CanEditOfficerNote()" would not always have the right to view officer channel.
  Reply With Quote
02-17-15, 08:02 PM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Can't you just check the guild rank?
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
02-17-15, 08:09 PM   #3
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,323
Originally Posted by siweia View Post
Is there any API that tell someone can use officer channel?

"CanEditOfficerNote()" would not always have the right to view officer channel.
CanEditOfficerNote() checks a different permission than the OFFICER channel. This function checks if you can set officer notes on members, which is a different mechanic entirely. There isn't a way to see if a specific rank has access to the guild's OFFICER channel without being the guild master.



Originally Posted by Seerah View Post
Can't you just check the guild rank?
The permissions for OFFICER channel is set by the guild master per rank. It isn't the same for every guild or for any specific rank globally.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 02-17-15 at 08:13 PM.
  Reply With Quote
02-18-15, 11:20 AM   #4
siweia
A Flamescale Wyrmkin
 
siweia's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2011
Posts: 126
Originally Posted by SDPhantom View Post
CanEditOfficerNote() checks a different permission than the OFFICER channel. This function checks if you can set officer notes on members, which is a different mechanic entirely. There isn't a way to see if a specific rank has access to the guild's OFFICER channel without being the guild master.




The permissions for OFFICER channel is set by the guild master per rank. It isn't the same for every guild or for any specific rank globally.
OK then, thanks.
  Reply With Quote
02-18-15, 12:46 PM   #5
Tim
A Rage Talon Dragon Guard
 
Tim's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 309
You will probably want to play with GuildControlGetRankFlags() - http://wow.gamepedia.com/API_GuildControlGetRankFlags

As SDPhantom already said though, different guilds set different permissions for ranks so you might have to implement a lot of checks to roughly guess whether or not they're an officer. Ideally only people that should return 1 in officerchat_speak would be officers but, who knows how every single person applies rank permissions.
__________________
AddOns: Tim @ WoWInterface
Battle Tag: Mysterio#11164
Current PC Setup: PCPartPicker List
  Reply With Quote
02-18-15, 02:10 PM   #6
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,323
I had assumed that it would require guild leader to check permissions, but apparently, that's only to set them. The code below should work.

Lua Code:
  1. local _,_,rank=GetGuildInfo("player");--    Get our rank ID (0-based index)
  2. GuildControlSetRank(rank+1);--  Set rank ID to check (1-based index)
  3. local _,_,listen,speak=GuildControlGetRankFlags();--    Get permission flags
  4.  
  5. if listen and speak then
  6. --  Do stuff
  7. end


PS: Blizzard made a change recently that converted all functions that return 1/nil to boolean.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 02-18-15 at 02:15 PM.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » API for Officer channel?


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off