MtApi5: implement SendNotification, SendMail, Comment, PlaySound#303
Open
biohazardxxx wants to merge 5 commits into
Open
MtApi5: implement SendNotification, SendMail, Comment, PlaySound#303biohazardxxx wants to merge 5 commits into
biohazardxxx wants to merge 5 commits into
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…hods Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements four MQL5 terminal notification/output functions that were reserved in
Mt5CommandType.csbut never wired up (//TODO). This makes chart comments, sound alerts, push notifications and terminal email reachable from the .NET client, end-to-end (C# client → EA handlers → recompiled.ex5).New methods on
MtApi5Client:bool Comment(string comments)bool PlaySound(string filename)bool SendNotification(string text)bool SendMail(string subject, string someText)Implementation notes
Comment = 137,PlaySound = 142,SendNotification = 144,SendMail = 145); only those four//TODOmarkers were removed. The remaining reserved ids (GetTickCount,GetMicrosecondCount,MessageBox,PeriodSeconds) are untouched.Print/Alertand follow thePrintpattern:SendCommand<bool>with a parameters dictionary, string params null-coalesced tostring.Empty. Payload keys:Comments,Filename,Text,Subject/SomeText.mq5/MtApi5.mq5) — handlers follow theExecute_Alert/Execute_Printstyle (GET_JSON_PAYLOAD+GET_STRING_JSON_VALUE, direct built-in calls).SendNotification/SendMail/PlaySoundpass the built-in'sboolresult through viaJSONBool(PlaySoundreturnsboolin MQL5, so its real result is passed through too).Comment()isvoidin MQL, so its handler returnsJSONBool(true)to satisfy the "return true after execution" contract, matching theExecute_Printprecedent. Executor registrations inserted in numeric order inpreinit().Comment,SendNotification) next to the existingPrint/Alertbuttons, reusing the existing MessageText textbox.PlaySound/SendMailhave no test buttons.Mt5CommandType.csand theADD_EXECUTORregistrations, byte-identical JSON payload keys on both sides, response marshaling via the provenJSONBool→{"ErrorCode":"0","Value":true}→SendCommand<bool>path used byGlobalVariableCheck) and found no defects.Testing
MtApi5builds with 0 warnings / 0 errors (Release);MtApi5TestClientbuilds with 0 errors (its nullable warnings are pre-existing, none in the added code).MtApi5.mq5compiles via MetaEditor with "Result: 0 errors"; the recompiledmq5/MtApi5.ex5is committed (a6ebc37).🤖 Generated with Claude Code