This repository was archived by the owner on Aug 16, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,41 @@ namespace Cyan
7070 {
7171 return this ->Plain (val);
7272 }
73+ bool operator ==(const MessageChain& mc) const
74+ {
75+ auto it1 = mc.messages_ .begin ();
76+ auto it2 = messages_.begin ();
77+
78+ for (; it1 != mc.messages_ .end () && it2 != messages_.end (); ++it1, ++it2)
79+ {
80+ if (it1.value ()[" type" ] != it2.value ()[" type" ]) return false ;
81+ if (it1.value ()[" type" ] == " At" )
82+ {
83+ if (it1.value ()[" target" ] != it2.value ()[" target" ]) return false ;
84+ }
85+ if (it1.value ()[" type" ] == " Face" )
86+ {
87+ if (it1.value ()[" faceId" ] != it2.value ()[" faceId" ]) return false ;
88+ }
89+ if (it1.value ()[" type" ] == " Plain" )
90+ {
91+ if (it1.value ()[" text" ] != it2.value ()[" text" ]) return false ;
92+ }
93+ if (it1.value ()[" type" ] == " Image" )
94+ {
95+ if (it1.value ()[" imageId" ] != it2.value ()[" imageId" ]) return false ;
96+ }
97+ if (it1.value ()[" type" ] == " FlashImage" )
98+ {
99+ if (it1.value ()[" imageId" ] != it2.value ()[" imageId" ]) return false ;
100+ }
101+ if (it1.value ()[" type" ] == " Poke" )
102+ {
103+ if (it1.value ()[" name" ] != it2.value ()[" name" ]) return false ;
104+ }
105+ }
106+ return true ;
107+ }
73108 virtual ~MessageChain () = default ;
74109 MessageChain& At (const QQ_t qq)
75110 {
You can’t perform that action at this time.
0 commit comments