Incognito

4 - Add a check to not say same name as logged in character name

What is the enhancement in mind? How should it look and feel?

If I tell Incognito to prefix messages with the character name 'Able', when I'm logged into 'Baker', I would want to see (Able), but if I'm logged into 'Able', I do NOT want to see it, as its redundant.

Please provide any additional information below.

I modified the function Incognito:SendChatMessage(msg, chatType, language, channel) to do this (see below).  You're free to use this code if you want.  I added an additional if check to see if the self.db.profile.name is the same as what is returned from UnitName("player"). ...

function Incognito:SendChatMessage(msg, chatType, language, channel)
    if self.db.profile.enable then
        if self.db.profile.name and self.db.profile.name ~= "" then
      profile_name, profile_realm = UnitName("player") -- If from your own realm, then profile_realm == nil (but the 2nd return value is still there).
      if self.db.profile.name ~= profile_name then
              if self.db.profile.guild and (chatType == "GUILD" or chatType == "OFFICER") then
                  msg = "(" .. self.db.profile.name .. "): " .. msg
              elseif self.db.profile.raid and chatType == "RAID" then
                  msg = "(" .. self.db.profile.name .. "): " .. msg
              elseif self.db.profile.party and chatType == "PARTY" then
                  msg = "(" .. self.db.profile.name .. "): " .. msg
              elseif self.db.profile.channel and chatType == "CHANNEL" then
                  local id, chname = GetChannelName(channel)
                  if strupper(self.db.profile.channel == strupper(chname) then
                      msg = "(" .. self.db.profile.name .. "): " .. msg
                  end
              end
      end
        end
    end
    
    -- Call original function
    self.hooks.SendChatMessage(msg, chatType, language, channel)
end

User When Change
nyyr May 25, 2014 at 18:23 UTC Changed status from Accepted to Fixed
nyyr Dec 16, 2013 at 10:14 UTC Changed status from New to Accepted

Changed assigned to from Trellmor to nyyr
CosmicCleric Dec 16, 2013 at 04:23 UTC Create

You must login to post a comment. Don't have an account? Register to get one!

  • 2 comments
  • Avatar of nyyr nyyr May 25, 2014 at 18:23 UTC - 0 likes

    added a respective configuration option

  • Avatar of nyyr nyyr Dec 16, 2013 at 10:14 UTC - 0 likes

    Thanks for the suggestion. In addition, I will have to add an configuration option for this since it might confuse people otherwise. ETA maybe in January.

  • 2 comments

Facts

Last updated
May 25, 2014
Reported
Dec 16, 2013
Status
Fixed - Developer made requested changes. QA should verify.
Type
Enhancement - A change which is intended to better the project in some way
Priority
Medium - Normal priority.
Votes
0

Reported by

Possible assignees