@@ -27,30 +27,30 @@ LazyCurve.lastMsgTime = 0
2727
2828--- @private
2929function LazyCurve :OnCancel (CancelButton )
30- if (self .DB .enableSimulation ) then
30+ if (self .DB .enableSimulation ) then
3131 LazyCurve :OnSignUp (CancelButton )
3232 end
3333end
3434
3535--- @private
3636--- @param SignUpButton LFGListApplicationDialog_SignUpButton | LFGListApplicationDialog_CancelButton
3737function LazyCurve :OnSignUp (SignUpButton )
38- if (self .DB .whisperOnApply ~= true ) then
38+ if (self .DB .whisperOnApply ~= true ) then
3939 return
4040 end
4141 --- @type LFGListApplicationDialog
4242 local dialog = SignUpButton :GetParent ()
4343 local resultID = dialog .resultID
4444 local resultInfo = C_LFGList .GetSearchResultInfo (resultID )
4545
46- if (resultInfo ) then
46+ if (resultInfo ) then
4747 local leaderName = resultInfo .leaderName
4848 local activityInfo = C_LFGList .GetActivityInfoTable (resultInfo .activityID or resultInfo .activityIDs [1 ])
4949 local infoTable = activityInfo
5050 and activityInfo .groupFinderActivityGroupID
5151 and LazyCurve .utils .searchEntryMenu :GetInfoTableByActivityGroup (activityInfo .groupFinderActivityGroupID , true )
5252
53- if (infoTable ) then
53+ if (infoTable ) then
5454 local achievementList = {}
5555
5656 for _ , activityTable in ipairs (infoTable ) do
@@ -67,15 +67,15 @@ function LazyCurve:OnSignUp(SignUpButton)
6767 message = message .. ' ' .. GetAchievementLink (achievementId )
6868 end
6969 if message == ' ' then
70- if (self .DB .enableSimulation ) then self :SimulationPrint (' no achievements found to whisper' ) end
70+ if (self .DB .enableSimulation ) then self :SimulationPrint (' no achievements found to whisper' ) end
7171 return
7272 end
7373
74- if (self .DB .advertise ) then
74+ if (self .DB .advertise ) then
7575 message = self .PREFIX .. message ;
7676 end
7777
78- if (self .DB .enableSimulation ) then
78+ if (self .DB .enableSimulation ) then
7979 self :SimulationPrint (' Intent to whisper "' , leaderName , ' " with message:' , message )
8080 return
8181 end
100100
101101--- @private
102102function LazyCurve :SimulationPrint (...)
103- if (self .DB .enableSimulation ) then
103+ if (self .DB .enableSimulation ) then
104104 self :Print (' [sim active]' , ... )
105105 end
106106end
@@ -130,11 +130,11 @@ function LazyCurve:ProcessMsg(message)
130130 message = self .utils .achievement .ReplaceKeywordWithAchievementLink (self , message , ' edge' , edge );
131131 end
132132
133- if (original ~= message and self .DB .advertise ) then
133+ if (original ~= message and self .DB .advertise ) then
134134 message = self .PREFIX .. message
135135 end
136136
137- if (original ~= message and self .DB .enableSimulation ) then
137+ if (original ~= message and self .DB .enableSimulation ) then
138138 self :SimulationPrint (' Intent to replace message with:' , message )
139139 return original
140140 end
@@ -149,16 +149,20 @@ end
149149
150150--- @private
151151function LazyCurve :SendChatMessage (msg , chatType , language , channel )
152- self .hooks .SendChatMessage (self :ProcessMsg (msg ), chatType , language , channel );
152+ if C_ChatInfo .SendChatMessage then
153+ self .hooks [C_ChatInfo ].SendChatMessage (self :ProcessMsg (msg ), chatType , language , channel );
154+ else
155+ self .hooks .SendChatMessage (self :ProcessMsg (msg ), chatType , language , channel );
156+ end
153157end
154158
155159--- @private
156160function LazyCurve :SendAchievement (leaderName , achievementId )
157161 local message = GetAchievementLink (achievementId )
158- if (self .DB .advertise ) then
162+ if (self .DB .advertise ) then
159163 message = self .PREFIX .. message
160164 end
161- if (self .DB .enableSimulation ) then
165+ if (self .DB .enableSimulation ) then
162166 self :SimulationPrint (' Intent to whisper "' , leaderName , ' " with message:' , message )
163167 return
164168 end
@@ -173,7 +177,11 @@ function LazyCurve:OnInitialize()
173177
174178 self .Config :Initialize ()
175179
176- self :RawHook (' SendChatMessage' , true )
180+ if C_ChatInfo .SendChatMessage then
181+ self :RawHook (C_ChatInfo , ' SendChatMessage' , true )
182+ else
183+ self :RawHook (' SendChatMessage' , true )
184+ end
177185 self :RawHook (' BNSendWhisper' , true )
178186 Menu .ModifyMenu (' MENU_LFG_FRAME_SEARCH_ENTRY' , function (owner , rootDescription )
179187 self :OnMenuOpen (owner , rootDescription )
0 commit comments