diff --git a/.idea/misc.xml b/.idea/misc.xml index 80a1400..2d8500d 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,3 +1,4 @@ + diff --git a/CHANGELOG.md b/CHANGELOG.md index b0475cb..829beed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,19 @@ +## 3.8.3+hotfix.10.1 + +- [Bug fixes and performance enhancements.](https://github.com/openimsdk/openim-sdk-core/releases/tag/v3.8.3-patch.10) + +## 3.8.3+hotfix.10 + +- [Bug fixes and performance enhancements.](https://github.com/openimsdk/openim-sdk-core/releases/tag/v3.8.3-patch.10) + +## 3.8.3+hotfix.7 + +- [Bug fixes and performance enhancements.](https://github.com/openimsdk/openim-sdk-core/releases/tag/v3.8.3-patch.7) + +## 3.8.3+3 + +- [Bug fixes and performance enhancements.](https://github.com/openimsdk/openim-sdk-core/releases/tag/v3.8.3-patch.3) + ## 3.8.2 - [Bug fixes and performance enhancements.](https://github.com/openimsdk/openim-sdk-core/releases/tag/v3.8.2) diff --git a/LICENSE b/LICENSE index 5c1804f..0ad25db 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,661 @@ -MIT License + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 -Copyright (c) 2018 OpenIM Corporation + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: + Preamble -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU Affero General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU AGPL, see +. diff --git a/README.md b/README.md index c266652..b6582a5 100644 --- a/README.md +++ b/README.md @@ -155,4 +155,14 @@ Check out our [user case studies](https://github.com/OpenIMSDK/community/blob/ma ## License :page_facing_up: -OpenIM is licensed under the Apache 2.0 license. See [LICENSE](https://github.com/openimsdk/open-im-server/tree/main/LICENSE) for the full license text. +This software is licensed under a dual-license model: + +- The GNU Affero General Public License (AGPL), Version 3 or later; **OR** +- Commercial license terms from OpenIMSDK. + +If you wish to use this software under commercial terms, please contact us at: contact@openim.io + +For more information, see: https://www.openim.io/en/licensing + + + diff --git a/android/.gitignore b/android/.gitignore index c6cbe56..161bdcd 100644 --- a/android/.gitignore +++ b/android/.gitignore @@ -6,3 +6,4 @@ .DS_Store /build /captures +.cxx diff --git a/android/build.gradle b/android/build.gradle index a2fb60f..79c7286 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,32 +1,16 @@ -group 'io.openim.flutter_openim_sdk' -version '1.0' - -def dir = getCurrentProjectDir() - -def getCurrentProjectDir() { - String result = "" - rootProject.allprojects { project -> - if (project.properties.get("name").toString() == "flutter_openim_sdk") { - result = project.properties.get("projectDir").toString() - } - } - return result -} +group = "io.openim.flutter_openim_sdk" +version = "1.0" buildscript { ext.kotlin_version = '2.0.20' repositories { - maven { url 'https://maven.aliyun.com/repository/public' } - maven { url 'https://maven.aliyun.com/repository/central' } - maven { url 'https://maven.aliyun.com/nexus/content/repositories/google' } - maven { url 'https://maven.aliyun.com/repository/gradle-plugin' } google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.3.1' + classpath 'com.android.tools.build:gradle:8.7.3' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } @@ -58,9 +42,21 @@ android { abiFilters "arm64-v8a","x86" // 根据需要添加其他 ABI } } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + + dependencies { + implementation 'io.openim:core-sdk:3.8.3-patch10@aar' + testImplementation("junit:junit:4.13.2") + testImplementation("org.mockito:mockito-core:5.0.0") + } + + testOptions { + unitTests.all { + testLogging { + events "passed", "skipped", "failed", "standardOut", "standardError" + outputs.upToDateWhen {false} + showStandardStreams = true + } + } } kotlinOptions { jvmTarget = '1.8' @@ -69,5 +65,5 @@ android { dependencies { //implementation 'com.openim:sdkcore:1.0.15-local' - implementation 'com.openim:sdkcore:1.0.18' -} \ No newline at end of file + implementation 'com.openim:sdkcore:1.0.19' +} diff --git a/android/gradle.properties b/android/gradle.properties deleted file mode 100644 index be9024e..0000000 --- a/android/gradle.properties +++ /dev/null @@ -1,4 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M -android.useAndroidX=true -android.enableJetifier=true -android.enableDexingArtifactTransform=false \ No newline at end of file diff --git a/android/libs/io/openim/core-sdk/0.0.1/core-sdk-0.0.1.pom b/android/libs/io/openim/core-sdk/0.0.1/core-sdk-0.0.1.pom deleted file mode 100644 index 41a78bc..0000000 --- a/android/libs/io/openim/core-sdk/0.0.1/core-sdk-0.0.1.pom +++ /dev/null @@ -1,9 +0,0 @@ - - - 4.0.0 - - io.openim - core-sdk - 0.0.1 - diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index 8c4c982..611d9ab 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -2,4 +2,4 @@ - \ No newline at end of file + diff --git a/android/src/main/java/io/openim/flutter_openim_sdk/manager/FriendshipManager.java b/android/src/main/java/io/openim/flutter_openim_sdk/manager/FriendshipManager.java index d987f60..6efae10 100644 --- a/android/src/main/java/io/openim/flutter_openim_sdk/manager/FriendshipManager.java +++ b/android/src/main/java/io/openim/flutter_openim_sdk/manager/FriendshipManager.java @@ -35,14 +35,16 @@ public class FriendshipManager extends BaseManager { public void getFriendApplicationListAsRecipient(MethodCall methodCall, MethodChannel.Result result) { Open_im_sdk.getFriendApplicationListAsRecipient( new OnBaseListener(result, methodCall), - value(methodCall, "operationID") + value(methodCall, "operationID"), + jsonValue(methodCall, "req") ); } public void getFriendApplicationListAsApplicant(MethodCall methodCall, MethodChannel.Result result) { Open_im_sdk.getFriendApplicationListAsApplicant( new OnBaseListener(result, methodCall), - value(methodCall, "operationID") + value(methodCall, "operationID"), + jsonValue(methodCall, "req") ); } @@ -135,4 +137,12 @@ public class FriendshipManager extends BaseManager { jsonValue(methodCall, "req") ); } + + public void getFriendApplicationUnhandledCount(MethodCall methodCall, MethodChannel.Result result) { + Open_im_sdk.getFriendApplicationUnhandledCount( + new OnBaseListener(result, methodCall), + value(methodCall, "operationID"), + jsonValue(methodCall, "req") + ); + } } diff --git a/android/src/main/java/io/openim/flutter_openim_sdk/manager/GroupManager.java b/android/src/main/java/io/openim/flutter_openim_sdk/manager/GroupManager.java index a5a2667..528ee4b 100644 --- a/android/src/main/java/io/openim/flutter_openim_sdk/manager/GroupManager.java +++ b/android/src/main/java/io/openim/flutter_openim_sdk/manager/GroupManager.java @@ -126,14 +126,16 @@ public class GroupManager extends BaseManager { public void getGroupApplicationListAsRecipient(MethodCall methodCall, MethodChannel.Result result) { Open_im_sdk.getGroupApplicationListAsRecipient( new OnBaseListener(result, methodCall), - value(methodCall, "operationID") + value(methodCall, "operationID"), + jsonValue(methodCall, "req") ); } public void getGroupApplicationListAsApplicant(MethodCall methodCall, MethodChannel.Result result) { Open_im_sdk.getGroupApplicationListAsApplicant( new OnBaseListener(result, methodCall), - value(methodCall, "operationID") + value(methodCall, "operationID"), + jsonValue(methodCall, "req") ); } @@ -240,4 +242,11 @@ public class GroupManager extends BaseManager { jsonValue(methodCall, "userIDs") ); } + + public void getGroupApplicationUnhandledCount(MethodCall methodCall, MethodChannel.Result result) { + Open_im_sdk.getGroupApplicationUnhandledCount(new OnBaseListener(result, methodCall), + value(methodCall, "operationID"), + jsonValue(methodCall, "req") + ); + } } \ No newline at end of file diff --git a/android/src/test/java/com/example/flutter_openim_sdk/FlutterOpenimSdkPluginTest.java b/android/src/test/java/com/example/flutter_openim_sdk/FlutterOpenimSdkPluginTest.java new file mode 100644 index 0000000..86b84ad --- /dev/null +++ b/android/src/test/java/com/example/flutter_openim_sdk/FlutterOpenimSdkPluginTest.java @@ -0,0 +1,33 @@ +package io.openim.flutter_openim_sdk; + +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; + +import io.flutter.plugin.common.MethodCall; +import io.flutter.plugin.common.MethodChannel; +import org.junit.Test; + +/** + * This demonstrates a simple unit test of the Java portion of this plugin's + * implementation. + * + * Once you have built the plugin's example app, you can run these tests from + * the command + * line by running `./gradlew testDebugUnitTest` in the `example/android/` + * directory, or + * you can run them directly from IDEs that support JUnit such as Android + * Studio. + */ + +public class FlutterOpenimSdkPluginTest { + @Test + public void onMethodCall_getPlatformVersion_returnsExpectedValue() { + FlutterOpenimSdkPlugin plugin = new FlutterOpenimSdkPlugin(); + + final MethodCall call = new MethodCall("getPlatformVersion", null); + MethodChannel.Result mockResult = mock(MethodChannel.Result.class); + plugin.onMethodCall(call, mockResult); + + verify(mockResult).success("Android " + android.os.Build.VERSION.RELEASE); + } +} diff --git a/example/.gitignore b/example/.gitignore index c005250..feffa20 100644 --- a/example/.gitignore +++ b/example/.gitignore @@ -5,9 +5,11 @@ *.swp .DS_Store .atom/ +.build/ .buildlog/ .history .svn/ +.swiftpm/ migrate_working_dir/ # IntelliJ related diff --git a/example/android/.gitignore b/example/android/.gitignore index 6f56801..be3943c 100644 --- a/example/android/.gitignore +++ b/example/android/.gitignore @@ -5,9 +5,10 @@ gradle-wrapper.jar /gradlew.bat /local.properties GeneratedPluginRegistrant.java +.cxx/ # Remember to never publicly share your keystore. -# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app +# See https://flutter.dev/to/reference-keystore key.properties **/*.keystore **/*.jks diff --git a/example/android/app/build.gradle.kts b/example/android/app/build.gradle.kts new file mode 100644 index 0000000..872c58f --- /dev/null +++ b/example/android/app/build.gradle.kts @@ -0,0 +1,44 @@ +plugins { + id("com.android.application") + id("kotlin-android") + // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. + id("dev.flutter.flutter-gradle-plugin") +} + +android { + namespace = "io.openim.flutter_openim_sdk_example" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_11.toString() + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId = "io.openim.flutter_openim_sdk_example" + // You can update the following values to match your application needs. + // For more information, see: https://flutter.dev/to/review-gradle-config. + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion + versionCode = flutter.versionCode + versionName = flutter.versionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig = signingConfigs.getByName("debug") + } + } +} + +flutter { + source = "../.." +} diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml index e6ebc72..8df2d15 100644 --- a/example/android/app/src/main/AndroidManifest.xml +++ b/example/android/app/src/main/AndroidManifest.xml @@ -8,7 +8,7 @@ ("clean") { + delete(rootProject.layout.buildDirectory) +} diff --git a/example/android/build/reports/problems/problems-report.html b/example/android/build/reports/problems/problems-report.html new file mode 100644 index 0000000..9da070b --- /dev/null +++ b/example/android/build/reports/problems/problems-report.html @@ -0,0 +1,663 @@ + + + + + + + + + + + + + Gradle Configuration Cache + + + +
+ +
+ Loading... +
+ + + + + + diff --git a/example/android/gradle.properties b/example/android/gradle.properties index 3b5b324..f018a61 100644 --- a/example/android/gradle.properties +++ b/example/android/gradle.properties @@ -1,3 +1,3 @@ -org.gradle.jvmargs=-Xmx4G -XX:+HeapDumpOnOutOfMemoryError +org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError android.useAndroidX=true android.enableJetifier=true diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties index e1ca574..ac3b479 100644 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip diff --git a/example/android/settings.gradle.kts b/example/android/settings.gradle.kts new file mode 100644 index 0000000..ab39a10 --- /dev/null +++ b/example/android/settings.gradle.kts @@ -0,0 +1,25 @@ +pluginManagement { + val flutterSdkPath = run { + val properties = java.util.Properties() + file("local.properties").inputStream().use { properties.load(it) } + val flutterSdkPath = properties.getProperty("flutter.sdk") + require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } + flutterSdkPath + } + + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") + + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +plugins { + id("dev.flutter.flutter-plugin-loader") version "1.0.0" + id("com.android.application") version "8.7.3" apply false + id("org.jetbrains.kotlin.android") version "2.1.0" apply false +} + +include(":app") diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 7bb90dd..7eb6643 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -2,8 +2,8 @@ PODS: - Flutter (1.0.0) - flutter_openim_sdk (0.0.1): - Flutter - - OpenIMSDKCore (= 3.8.2) - - OpenIMSDKCore (3.8.2) + - OpenIMSDKCore (= 3.8.3-hotfix.10) + - OpenIMSDKCore (3.8.3-hotfix.10) DEPENDENCIES: - Flutter (from `Flutter`) @@ -21,9 +21,9 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 - flutter_openim_sdk: 77bdd08fb8dda1644a0c150b8ba7324f11b32404 - OpenIMSDKCore: aaffd63079a874d9272b8b962598723cb8128d32 + flutter_openim_sdk: 59aa0c08eb7499a1790168e10539e4dd915ced6e + OpenIMSDKCore: bc9a6e5de2aabed76e4f69fe06a7c9df1d945afc PODFILE CHECKSUM: 819463e6a0290f5a72f145ba7cde16e8b6ef0796 -COCOAPODS: 1.15.2 +COCOAPODS: 1.16.2 diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index b9e7c52..d7570d1 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -198,6 +198,7 @@ 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + 477B57FDE7C120496D1FEA7A /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -307,6 +308,23 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; + 477B57FDE7C120496D1FEA7A /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Copy Pods Resources"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; 70DBF52745AF25A4FC72D8C3 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; diff --git a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 8e3ca5d..e3773d4 100644 --- a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -26,6 +26,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit" shouldUseLaunchSchemeArgsEnv = "YES"> diff --git a/example/lib/main.dart b/example/lib/main.dart index 63989c9..8a9dfa2 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -18,7 +18,7 @@ class MyApp extends StatefulWidget { const MyApp({super.key}); @override - _MyAppState createState() => _MyAppState(); + State createState() => _MyAppState(); } class _MyAppState extends State { diff --git a/ios/Classes/Module/FriendshipManager.swift b/ios/Classes/Module/FriendshipManager.swift index 06fd37b..df33753 100644 --- a/ios/Classes/Module/FriendshipManager.swift +++ b/ios/Classes/Module/FriendshipManager.swift @@ -21,6 +21,7 @@ public class FriendshipManager: BaseServiceManager { self["searchFriends"] = searchFriends self["setFriendListener"] = setFriendListener self["updateFriends"] = updateFriends + self["getFriendApplicationUnhandledCount"] = getFriendApplicationUnhandledCount } func acceptFriendApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ @@ -48,11 +49,11 @@ public class FriendshipManager: BaseServiceManager { } func getFriendApplicationListAsApplicant(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkGetFriendApplicationListAsApplicant(BaseCallback(result: result), methodCall[string: "operationID"]) + Open_im_sdkGetFriendApplicationListAsApplicant(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "req"]) } func getFriendApplicationListAsRecipient(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkGetFriendApplicationListAsRecipient(BaseCallback(result: result), methodCall[string: "operationID"]) + Open_im_sdkGetFriendApplicationListAsRecipient(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "req"]) } func getFriendList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ @@ -87,6 +88,10 @@ public class FriendshipManager: BaseServiceManager { func updateFriends(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ Open_im_sdkUpdateFriends(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "req"]) } + + func getFriendApplicationUnhandledCount(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ + Open_im_sdkGetFriendApplicationUnhandledCount(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "req"]) + } } public class FriendshipListener: NSObject, Open_im_sdk_callbackOnFriendshipListenerProtocol { diff --git a/ios/Classes/Module/GroupManager.swift b/ios/Classes/Module/GroupManager.swift index 62e2bd3..1e4db81 100644 --- a/ios/Classes/Module/GroupManager.swift +++ b/ios/Classes/Module/GroupManager.swift @@ -32,6 +32,7 @@ public class GroupManager: BaseServiceManager { self["setGroupListener"] = setGroupListener self["setGroupMemberInfo"] = setGroupMemberInfo self["transferGroupOwner"] = transferGroupOwner + self["getGroupApplicationUnhandledCount"] = getGroupApplicationUnhandledCount } func acceptGroupApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult) { @@ -55,11 +56,11 @@ public class GroupManager: BaseServiceManager { } func getGroupApplicationListAsApplicant(methodCall: FlutterMethodCall, result: @escaping FlutterResult) { - Open_im_sdkGetGroupApplicationListAsApplicant(BaseCallback(result: result), methodCall[string: "operationID"]) + Open_im_sdkGetGroupApplicationListAsApplicant(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "req"]) } func getGroupApplicationListAsRecipient(methodCall: FlutterMethodCall, result: @escaping FlutterResult) { - Open_im_sdkGetGroupApplicationListAsRecipient(BaseCallback(result: result), methodCall[string: "operationID"]) + Open_im_sdkGetGroupApplicationListAsRecipient(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "req"]) } func getGroupMemberList(methodCall: FlutterMethodCall, result: @escaping FlutterResult) { @@ -147,6 +148,10 @@ public class GroupManager: BaseServiceManager { func transferGroupOwner(methodCall: FlutterMethodCall, result: @escaping FlutterResult) { Open_im_sdkTransferGroupOwner(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[string: "userID"]) } + + func getGroupApplicationUnhandledCount(methodCall: FlutterMethodCall, result: @escaping FlutterResult) { + Open_im_sdkGetGroupApplicationUnhandledCount(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "req"]) + } } public class GroupListener: NSObject, Open_im_sdk_callbackOnGroupListenerProtocol { diff --git a/ios/Resources/PrivacyInfo.xcprivacy b/ios/Resources/PrivacyInfo.xcprivacy new file mode 100644 index 0000000..e19fdbc --- /dev/null +++ b/ios/Resources/PrivacyInfo.xcprivacy @@ -0,0 +1,23 @@ + + + + + NSPrivacyTracking + + NSPrivacyCollectedDataTypes + + NSPrivacyTrackingDomains + + NSPrivacyAccessedAPITypes + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryUserDefaults + NSPrivacyAccessedAPITypeReasons + + CA92.1 + + + + + diff --git a/ios/flutter_openim_sdk.podspec b/ios/flutter_openim_sdk.podspec index ad3da02..82416e3 100644 --- a/ios/flutter_openim_sdk.podspec +++ b/ios/flutter_openim_sdk.podspec @@ -4,7 +4,7 @@ # Pod::Spec.new do |s| s.name = 'flutter_openim_sdk' - s.version = '0.0.13' + s.version = '0.0.14' s.summary = 'A new Flutter project.' s.description = <<-DESC A new Flutter project. @@ -19,7 +19,7 @@ A new Flutter project. #s.ios.vendored_frameworks = 'frameworks/*.xcframework' #s.vendored_frameworks = 'frameworks/*.xcframework' - s.dependency 'openim_sdk_core_ios','0.13.0' + s.dependency 'openim_sdk_core_ios','0.14.0' s.static_framework = true s.library = 'resolv' @@ -30,4 +30,6 @@ A new Flutter project. # Flutter.framework does not contain a i386 slice. s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386 arm64' } s.swift_version = '5.0' + + s.resource_bundles = {'flutter_openim_sdk_privacy' => ['Resources/PrivacyInfo.xcprivacy']} end diff --git a/lib/src/manager/im_friendship_manager.dart b/lib/src/manager/im_friendship_manager.dart index 71211e7..94d1409 100644 --- a/lib/src/manager/im_friendship_manager.dart +++ b/lib/src/manager/im_friendship_manager.dart @@ -50,22 +50,36 @@ class FriendshipManager { })); /// Get Friend Requests Sent to Me - Future> getFriendApplicationListAsRecipient({String? operationID}) => _channel - .invokeMethod( - 'getFriendApplicationListAsRecipient', - _buildParam({ - "operationID": Utils.checkOperationID(operationID), - })) - .then((value) => Utils.toList(value, (v) => FriendApplicationInfo.fromJson(v))); + Future> getFriendApplicationListAsRecipient( + {GetFriendApplicationListAsRecipientReq? req, String? operationID}) { + if (req != null && req.offset > 0) { + assert(req.count > 0, 'count must be greater than 0'); + } + return _channel + .invokeMethod( + 'getFriendApplicationListAsRecipient', + _buildParam({ + 'req': req?.toJson() ?? {}, + "operationID": Utils.checkOperationID(operationID), + })) + .then((value) => Utils.toList(value, (v) => FriendApplicationInfo.fromJson(v))); + } /// Get Friend Requests Sent by Me - Future> getFriendApplicationListAsApplicant({String? operationID}) => _channel - .invokeMethod( - 'getFriendApplicationListAsApplicant', - _buildParam({ - "operationID": Utils.checkOperationID(operationID), - })) - .then((value) => Utils.toList(value, (v) => FriendApplicationInfo.fromJson(v))); + Future> getFriendApplicationListAsApplicant( + {GetFriendApplicationListAsApplicantReq? req, String? operationID}) { + if (req != null && req.offset > 0) { + assert(req.count > 0, 'count must be greater than 0'); + } + return _channel + .invokeMethod( + 'getFriendApplicationListAsApplicant', + _buildParam({ + 'req': req?.toJson() ?? {}, + "operationID": Utils.checkOperationID(operationID), + })) + .then((value) => Utils.toList(value, (v) => FriendApplicationInfo.fromJson(v))); + } /// Get Friend List, including friends who have been put into the blacklist Future> getFriendList({ @@ -286,6 +300,17 @@ class FriendshipManager { .then((value) => value); } + Future getFriendApplicationUnhandledCount(GetFriendApplicationUnhandledCountReq req, + {String? operationID}) => + _channel + .invokeMethod( + 'getFriendApplicationUnhandledCount', + _buildParam({ + 'req': req.toJson(), + 'operationID': Utils.checkOperationID(operationID), + })) + .then((value) => int.parse(value)); + static Map _buildParam(Map param) { param["ManagerName"] = "friendshipManager"; param = Utils.cleanMap(param); diff --git a/lib/src/manager/im_group_manager.dart b/lib/src/manager/im_group_manager.dart index 8d0d447..b14fceb 100644 --- a/lib/src/manager/im_group_manager.dart +++ b/lib/src/manager/im_group_manager.dart @@ -18,43 +18,39 @@ class GroupManager { /// Invite users to a group, allowing them to join without approval. /// [groupID] Group ID /// [userIDList] List of user IDs - Future> inviteUserToGroup({ + Future inviteUserToGroup({ required String groupID, required List userIDList, String? reason, String? operationID, }) => - _channel - .invokeMethod( - 'inviteUserToGroup', - _buildParam({ - 'groupID': groupID, - 'userIDList': userIDList, - 'reason': reason, - "operationID": Utils.checkOperationID(operationID), - })) - .then((value) => Utils.toList(value, (map) => GroupInviteResult.fromJson(map))); + _channel.invokeMethod( + 'inviteUserToGroup', + _buildParam({ + 'groupID': groupID, + 'userIDList': userIDList, + 'reason': reason, + "operationID": Utils.checkOperationID(operationID), + })); /// Remove group members /// [groupID] Group ID /// [userIDList] List of user IDs /// [reason] Reason for removal - Future> kickGroupMember({ + Future kickGroupMember({ required String groupID, required List userIDList, String? reason, String? operationID, }) => - _channel - .invokeMethod( - 'kickGroupMember', - _buildParam({ - 'groupID': groupID, - 'userIDList': userIDList, - 'reason': reason, - "operationID": Utils.checkOperationID(operationID), - })) - .then((value) => Utils.toList(value, (map) => GroupInviteResult.fromJson(map))); + _channel.invokeMethod( + 'kickGroupMember', + _buildParam({ + 'groupID': groupID, + 'userIDList': userIDList, + 'reason': reason, + "operationID": Utils.checkOperationID(operationID), + })); /// Query group member information /// [groupID] Group ID @@ -131,15 +127,17 @@ class GroupManager { })) .then((value) => Utils.toList(value, (map) => GroupInfo.fromJson(map))); - Future> getJoinedGroupListPage({String? operationID, int offset = 0, int count = 40}) => _channel - .invokeMethod( - 'getJoinedGroupListPage', - _buildParam({ - 'offset': offset, - 'count': count, - 'operationID': Utils.checkOperationID(operationID), - })) - .then((value) => Utils.toList(value, (map) => GroupInfo.fromJson(map))); + Future> getJoinedGroupListPage( + {String? operationID, int offset = 0, int count = 40}) => + _channel + .invokeMethod( + 'getJoinedGroupListPage', + _buildParam({ + 'offset': offset, + 'count': count, + 'operationID': Utils.checkOperationID(operationID), + })) + .then((value) => Utils.toList(value, (map) => GroupInfo.fromJson(map))); /// Query the list of joined groups Future> getJoinedGroupListMap({String? operationID}) => _channel @@ -218,7 +216,11 @@ class GroupManager { /// Apply to join a group, requiring approval from an administrator or the group. /// [joinSource] 2: Invited, 3: Searched, 4: Using a QR code Future joinGroup( - {required String groupID, String? reason, String? operationID, int joinSource = 3, String? ex}) => + {required String groupID, + String? reason, + String? operationID, + int joinSource = 3, + String? ex}) => _channel.invokeMethod( 'joinGroup', _buildParam({ @@ -258,22 +260,41 @@ class GroupManager { })); /// Handle group membership applications received as a group owner or administrator - Future> getGroupApplicationListAsRecipient({String? operationID}) => _channel - .invokeMethod( - 'getGroupApplicationListAsRecipient', - _buildParam({ - 'operationID': Utils.checkOperationID(operationID), - })) - .then((value) => Utils.toList(value, (map) => GroupApplicationInfo.fromJson(map))); + Future> getGroupApplicationListAsRecipient({ + GetGroupApplicationListAsRecipientReq? req, + String? operationID, + }) { + if (req != null && req.offset > 0) { + assert(req.count > 0, 'count must be greater than 0'); + } + return _channel + .invokeMethod( + 'getGroupApplicationListAsRecipient', + _buildParam({ + 'req': req?.toJson() ?? {}, + "operationID": Utils.checkOperationID(operationID), + })) + .then((value) => Utils.toList(value, (map) => GroupApplicationInfo.fromJson(map))); + } /// Get the list of group membership applications sent by the user - Future> getGroupApplicationListAsApplicant({String? operationID}) => _channel - .invokeMethod( - 'getGroupApplicationListAsApplicant', - _buildParam({ - 'operationID': Utils.checkOperationID(operationID), - })) - .then((value) => Utils.toList(value, (map) => GroupApplicationInfo.fromJson(map))); + Future> getGroupApplicationListAsApplicant({ + GetGroupApplicationListAsApplicantReq? req, + String? operationID, + }) { + if (req != null && req.offset > 0) { + assert(req.count > 0, 'count must be greater than 0'); + } + + return _channel + .invokeMethod( + 'getGroupApplicationListAsApplicant', + _buildParam({ + 'req': req?.toJson() ?? {}, + "operationID": Utils.checkOperationID(operationID), + })) + .then((value) => Utils.toList(value, (map) => GroupApplicationInfo.fromJson(map))); + } /// Accept a group membership application as an administrator or group owner /// Note: Membership applications require approval from administrators or the group. @@ -584,13 +605,22 @@ class GroupManager { 'operationID': Utils.checkOperationID(operationID), })); + Future getGroupApplicationUnhandledCount(GetGroupApplicationUnhandledCountReq req, + {String? operationID}) => + _channel + .invokeMethod( + 'getGroupApplicationUnhandledCount', + _buildParam({ + 'req': req.toJson(), + 'operationID': Utils.checkOperationID(operationID), + })) + .then((value) => int.parse(value)); + static Map _buildParam(Map param) { param["ManagerName"] = "groupManager"; param = Utils.cleanMap(param); log('param: $param'); - + return param; } - - } diff --git a/lib/src/manager/im_manager.dart b/lib/src/manager/im_manager.dart index fe44eee..5d326ba 100644 --- a/lib/src/manager/im_manager.dart +++ b/lib/src/manager/im_manager.dart @@ -481,8 +481,8 @@ class IMManager { } /// Deinitialize the SDK - Future unInitSDK() { - return _channel.invokeMethod('unInitSDK', _buildParam({})); + void unInitSDK() { + _channel.invokeMethod('unInitSDK', _buildParam({})); } /// Login diff --git a/lib/src/models/group_info.dart b/lib/src/models/group_info.dart index df65b13..ccb91b8 100644 --- a/lib/src/models/group_info.dart +++ b/lib/src/models/group_info.dart @@ -422,3 +422,90 @@ class GroupInviteResult { return data; } } + +class GetGroupApplicationListAsRecipientReq { + final List groupIDs; + final List handleResults; + final int offset; + final int count; + + GetGroupApplicationListAsRecipientReq({ + this.groupIDs = const [], + this.handleResults = const [], + required this.offset, + required this.count, + }); + + GetGroupApplicationListAsRecipientReq.fromJson(Map json) + : groupIDs = json['groupIDs'] == null ? [] : List.from(json['groupIDs'].map((x) => x)), + handleResults = json['handleResults'] == null ? [] : List.from(json['handleResults'].map((x) => x)), + offset = json['offset'], + count = json['count']; + + Map toJson() { + final data = {}; + data['groupIDs'] = groupIDs; + data['handleResults'] = handleResults; + data['offset'] = offset; + data['count'] = count; + return data; + } + + @override + String toString() { + return 'GetGroupApplicationListAsRecipientReq{groupIDs: $groupIDs, handleResults: $handleResults, offset: $offset, count: $count}'; + } +} + +class GetGroupApplicationListAsApplicantReq { + final List groupIDs; + final List handleResults; + final int offset; + final int count; + + GetGroupApplicationListAsApplicantReq({ + this.groupIDs = const [], + this.handleResults = const [], + required this.offset, + required this.count, + }); + + GetGroupApplicationListAsApplicantReq.fromJson(Map json) + : groupIDs = json['groupIDs'] == null ? [] : List.from(json['groupIDs'].map((x) => x)), + handleResults = json['handleResults'] == null ? [] : List.from(json['handleResults'].map((x) => x)), + offset = json['offset'], + count = json['count']; + + Map toJson() { + final data = {}; + data['groupIDs'] = groupIDs; + data['handleResults'] = handleResults; + data['offset'] = offset; + data['count'] = count; + return data; + } + + @override + String toString() { + return 'GetGroupApplicationListAsApplicantReq{groupIDs: $groupIDs, handleResults: $handleResults, offset: $offset, count: $count}'; + } +} + +class GetGroupApplicationUnhandledCountReq { + final int time; + + GetGroupApplicationUnhandledCountReq({this.time = 0}); + + GetGroupApplicationUnhandledCountReq.fromJson(Map json) : time = json['time']; + + Map toJson() { + final data = {}; + data['time'] = time; + return data; + } + + @override + String toString() { + return 'GetGroupApplicationUnhandledCountReq{time: $time}'; + } +} diff --git a/lib/src/models/notification_info.dart b/lib/src/models/notification_info.dart index ff98fea..17b81f7 100644 --- a/lib/src/models/notification_info.dart +++ b/lib/src/models/notification_info.dart @@ -1,6 +1,6 @@ import '../../flutter_openim_sdk.dart'; -/// OA notification +/// OA Notification class OANotification { /// Title String? notificationName; @@ -58,57 +58,50 @@ class OANotification { text = json['text']; externalUrl = json['externalUrl']; mixType = json['mixType']; - pictureElem = json['pictureElem'] != null - ? PictureElem.fromJson(json['pictureElem']) - : null; - soundElem = json['soundElem'] != null - ? SoundElem.fromJson(json['soundElem']) - : null; - videoElem = json['videoElem'] != null - ? VideoElem.fromJson(json['videoElem']) - : null; - fileElem = - json['fileElem'] != null ? FileElem.fromJson(json['fileElem']) : null; + pictureElem = json['pictureElem'] != null ? PictureElem.fromJson(json['pictureElem']) : null; + soundElem = json['soundElem'] != null ? SoundElem.fromJson(json['soundElem']) : null; + videoElem = json['videoElem'] != null ? VideoElem.fromJson(json['videoElem']) : null; + fileElem = json['fileElem'] != null ? FileElem.fromJson(json['fileElem']) : null; ex = json['ex']; } Map toJson() { final data = Map(); - data['notificationName'] = this.notificationName; - data['notificationFaceURL'] = this.notificationFaceURL; - data['notificationType'] = this.notificationType; - data['text'] = this.text; - data['externalUrl'] = this.externalUrl; - data['mixType'] = this.mixType; - if (this.pictureElem != null) { - data['pictureElem'] = this.pictureElem!.toJson(); + data['notificationName'] = notificationName; + data['notificationFaceURL'] = notificationFaceURL; + data['notificationType'] = notificationType; + data['text'] = text; + data['externalUrl'] = externalUrl; + data['mixType'] = mixType; + if (pictureElem != null) { + data['pictureElem'] = pictureElem!.toJson(); } - if (this.soundElem != null) { - data['soundElem'] = this.soundElem!.toJson(); + if (soundElem != null) { + data['soundElem'] = soundElem!.toJson(); } - if (this.videoElem != null) { - data['videoElem'] = this.videoElem!.toJson(); + if (videoElem != null) { + data['videoElem'] = videoElem!.toJson(); } - if (this.fileElem != null) { - data['fileElem'] = this.fileElem!.toJson(); + if (fileElem != null) { + data['fileElem'] = fileElem!.toJson(); } - data['ex'] = this.ex; + data['ex'] = ex; return data; } } -/// 群事件通知 +/// Group Event Notification class GroupNotification { - /// 群信息 + /// Group information GroupInfo? group; - /// 当前事件操作者信息 + /// Current event operator information GroupMembersInfo? opUser; - /// 群拥有者信息 + /// Group owner information GroupMembersInfo? groupOwnerUser; - /// 产生影响的群成员列表 + /// List of affected group members List? memberList; GroupNotification({ @@ -120,12 +113,8 @@ class GroupNotification { GroupNotification.fromJson(Map json) { group = json['group'] != null ? GroupInfo.fromJson(json['group']) : null; - opUser = json['opUser'] != null - ? GroupMembersInfo.fromJson(json['opUser']) - : null; - groupOwnerUser = json['groupOwnerUser'] != null - ? GroupMembersInfo.fromJson(json['groupOwnerUser']) - : null; + opUser = json['opUser'] != null ? GroupMembersInfo.fromJson(json['opUser']) : null; + groupOwnerUser = json['groupOwnerUser'] != null ? GroupMembersInfo.fromJson(json['groupOwnerUser']) : null; if (json['memberList'] != null) { memberList = []; json['memberList'].forEach((v) { @@ -136,40 +125,42 @@ class GroupNotification { Map toJson() { final data = Map(); - if (this.group != null) { - data['group'] = this.group!.toJson(); + if (group != null) { + data['group'] = group!.toJson(); } - if (this.opUser != null) { - data['opUser'] = this.opUser!.toJson(); + if (opUser != null) { + data['opUser'] = opUser!.toJson(); } - if (this.groupOwnerUser != null) { - data['groupOwnerUser'] = this.groupOwnerUser!.toJson(); + if (groupOwnerUser != null) { + data['groupOwnerUser'] = groupOwnerUser!.toJson(); } - if (this.memberList != null) { - data['memberList'] = this.memberList!.map((v) => v.toJson()).toList(); + if (memberList != null) { + data['memberList'] = memberList!.map((v) => v.toJson()).toList(); } return data; } } -/// 用户被邀请进群通知 +/// User Invited to Join Group Notification class InvitedJoinGroupNotification { - /// 群信息 + /// Group information GroupInfo? group; - /// 操作者信息 + /// Operator information GroupMembersInfo? opUser; - /// 被邀请进群的成员信息 + /// Inviter information + GroupMembersInfo? inviterUser; + + /// List of members invited to join the group List? invitedUserList; InvitedJoinGroupNotification({this.group, this.opUser, this.invitedUserList}); InvitedJoinGroupNotification.fromJson(Map json) { group = json['group'] != null ? GroupInfo.fromJson(json['group']) : null; - opUser = json['opUser'] != null - ? GroupMembersInfo.fromJson(json['opUser']) - : null; + opUser = json['opUser'] != null ? GroupMembersInfo.fromJson(json['opUser']) : null; + inviterUser = json['inviterUser'] != null ? GroupMembersInfo.fromJson(json['inviterUser']) : null; if (json['invitedUserList'] != null) { invitedUserList = []; json['invitedUserList'].forEach((v) { @@ -179,40 +170,39 @@ class InvitedJoinGroupNotification { } Map toJson() { - final Map data = new Map(); - if (this.group != null) { - data['group'] = this.group!.toJson(); + final Map data = {}; + if (group != null) { + data['group'] = group!.toJson(); } - if (this.opUser != null) { - data['opUser'] = this.opUser!.toJson(); + if (opUser != null) { + data['opUser'] = opUser!.toJson(); } - if (this.invitedUserList != null) { - data['invitedUserList'] = - this.invitedUserList!.map((v) => v.toJson()).toList(); + if (inviterUser != null) { + data['inviterUser'] = inviterUser!.toJson(); + } + if (invitedUserList != null) { + data['invitedUserList'] = invitedUserList!.map((v) => v.toJson()).toList(); } return data; } } -/// 组踢出成员通知 +/// Group Member Kicked Notification class KickedGroupMemeberNotification { - /// 群信息 + /// Group information GroupInfo? group; - /// 操作者信息 + /// Operator information GroupMembersInfo? opUser; - /// 被踢出群的成员信息列表 + /// List of members kicked from the group List? kickedUserList; - KickedGroupMemeberNotification( - {this.group, this.opUser, this.kickedUserList}); + KickedGroupMemeberNotification({this.group, this.opUser, this.kickedUserList}); KickedGroupMemeberNotification.fromJson(Map json) { group = json['group'] != null ? GroupInfo.fromJson(json['group']) : null; - opUser = json['opUser'] != null - ? GroupMembersInfo.fromJson(json['opUser']) - : null; + opUser = json['opUser'] != null ? GroupMembersInfo.fromJson(json['opUser']) : null; if (json['kickedUserList'] != null) { kickedUserList = []; json['kickedUserList'].forEach((v) { @@ -223,87 +213,82 @@ class KickedGroupMemeberNotification { Map toJson() { final Map data = new Map(); - if (this.group != null) { - data['group'] = this.group!.toJson(); + if (group != null) { + data['group'] = group!.toJson(); } - if (this.opUser != null) { - data['opUser'] = this.opUser!.toJson(); + if (opUser != null) { + data['opUser'] = opUser!.toJson(); } - if (this.kickedUserList != null) { - data['kickedUserList'] = - this.kickedUserList!.map((v) => v.toJson()).toList(); + if (kickedUserList != null) { + data['kickedUserList'] = kickedUserList!.map((v) => v.toJson()).toList(); } return data; } } -/// 退出群通知 +/// Quit Group Notification class QuitGroupNotification { - /// 群信息 + /// Group information GroupInfo? group; - /// 退群的成员信息 + /// Information of the member who quit the group GroupMembersInfo? quitUser; QuitGroupNotification({this.group, this.quitUser}); QuitGroupNotification.fromJson(Map json) { group = json['group'] != null ? GroupInfo.fromJson(json['group']) : null; - quitUser = json['quitUser'] != null - ? GroupMembersInfo.fromJson(json['quitUser']) - : null; + quitUser = json['quitUser'] != null ? GroupMembersInfo.fromJson(json['quitUser']) : null; } Map toJson() { final data = Map(); - if (this.group != null) { - data['group'] = this.group!.toJson(); + if (group != null) { + data['group'] = group!.toJson(); } - if (this.quitUser != null) { - data['quitUser'] = this.quitUser!.toJson(); + if (quitUser != null) { + data['quitUser'] = quitUser!.toJson(); } return data; } } -/// 进群通知 +/// Enter Group Notification class EnterGroupNotification { - /// 群信息 + /// Group information GroupInfo? group; - /// 进入群的成员信息 + /// Information of the member who entered the group GroupMembersInfo? entrantUser; EnterGroupNotification({this.group, this.entrantUser}); EnterGroupNotification.fromJson(Map json) { group = json['group'] != null ? GroupInfo.fromJson(json['group']) : null; - entrantUser = json['entrantUser'] != null - ? GroupMembersInfo.fromJson(json['entrantUser']) - : null; + entrantUser = json['entrantUser'] != null ? GroupMembersInfo.fromJson(json['entrantUser']) : null; } Map toJson() { final data = Map(); - if (this.group != null) { - data['group'] = this.group!.toJson(); + if (group != null) { + data['group'] = group!.toJson(); } - if (this.entrantUser != null) { - data['quitUser'] = this.entrantUser!.toJson(); + if (entrantUser != null) { + data['entrantUser'] = entrantUser!.toJson(); } return data; } } -/// 群权转让通知 +/// Group Rights Transfer Notification class GroupRightsTransferNoticication { - /// 群信息 + /// Group information GroupInfo? group; - /// 操作者信息 + /// Operator information GroupMembersInfo? opUser; - /// 群新的拥有者信息 + /// New group owner information GroupMembersInfo? newGroupOwner; GroupRightsTransferNoticication({ @@ -314,41 +299,37 @@ class GroupRightsTransferNoticication { GroupRightsTransferNoticication.fromJson(Map json) { group = json['group'] != null ? GroupInfo.fromJson(json['group']) : null; - opUser = json['opUser'] != null - ? GroupMembersInfo.fromJson(json['opUser']) - : null; - newGroupOwner = json['newGroupOwner'] != null - ? GroupMembersInfo.fromJson(json['newGroupOwner']) - : null; + opUser = json['opUser'] != null ? GroupMembersInfo.fromJson(json['opUser']) : null; + newGroupOwner = json['newGroupOwner'] != null ? GroupMembersInfo.fromJson(json['newGroupOwner']) : null; } Map toJson() { final data = Map(); - if (this.group != null) { - data['group'] = this.group!.toJson(); + if (group != null) { + data['group'] = group!.toJson(); } - if (this.opUser != null) { - data['opUser'] = this.opUser!.toJson(); + if (opUser != null) { + data['opUser'] = opUser!.toJson(); } - if (this.newGroupOwner != null) { - data['newGroupOwner'] = this.newGroupOwner!.toJson(); + if (newGroupOwner != null) { + data['newGroupOwner'] = newGroupOwner!.toJson(); } return data; } } -/// 禁言成员通知 +/// Mute Member Notification class MuteMemberNotification { - /// 群信息 + /// Group information GroupInfo? group; - /// 操作者信息 + /// Operator information GroupMembersInfo? opUser; - /// 被禁言的成员信息 + /// Muted member information GroupMembersInfo? mutedUser; - /// 禁言时间s + /// Mute duration in seconds int? mutedSeconds; MuteMemberNotification({ @@ -360,40 +341,36 @@ class MuteMemberNotification { MuteMemberNotification.fromJson(Map json) { group = json['group'] != null ? GroupInfo.fromJson(json['group']) : null; - opUser = json['opUser'] != null - ? GroupMembersInfo.fromJson(json['opUser']) - : null; - mutedUser = json['mutedUser'] != null - ? GroupMembersInfo.fromJson(json['mutedUser']) - : null; + opUser = json['opUser'] != null ? GroupMembersInfo.fromJson(json['opUser']) : null; + mutedUser = json['mutedUser'] != null ? GroupMembersInfo.fromJson(json['mutedUser']) : null; mutedSeconds = json['mutedSeconds']; } Map toJson() { final data = Map(); - if (this.group != null) { - data['group'] = this.group!.toJson(); + if (group != null) { + data['group'] = group!.toJson(); } - if (this.opUser != null) { - data['opUser'] = this.opUser!.toJson(); + if (opUser != null) { + data['opUser'] = opUser!.toJson(); } - if (this.mutedUser != null) { - data['mutedUser'] = this.mutedUser!.toJson(); + if (mutedUser != null) { + data['mutedUser'] = mutedUser!.toJson(); } - data['mutedSeconds'] = this.mutedSeconds; + data['mutedSeconds'] = mutedSeconds; return data; } } -/// 阅后即焚通知 +/// Burn After Reading Notification class BurnAfterReadingNotification { - /// 接收者 + /// Receiver String? recvID; - /// 发送者 + /// Sender String? sendID; - /// 是否开启 + /// Whether enabled bool? isPrivate; BurnAfterReadingNotification({this.recvID, this.sendID, this.isPrivate}); @@ -406,22 +383,22 @@ class BurnAfterReadingNotification { Map toJson() { final data = Map(); - data['recvID'] = this.recvID; - data['sendID'] = this.sendID; - data['isPrivate'] = this.isPrivate; + data['recvID'] = recvID; + data['sendID'] = sendID; + data['isPrivate'] = isPrivate; return data; } } -/// 群成员信息发送变化通知 +/// Group Member Information Changed Notification class GroupMemberInfoChangedNotification { - /// 群信息 + /// Group information GroupInfo? group; - /// 操作者信息 + /// Operator information GroupMembersInfo? opUser; - /// 资料发生改变的成员 + /// Member with changed information GroupMembersInfo? changedUser; GroupMemberInfoChangedNotification({ @@ -432,24 +409,20 @@ class GroupMemberInfoChangedNotification { GroupMemberInfoChangedNotification.fromJson(Map json) { group = json['group'] != null ? GroupInfo.fromJson(json['group']) : null; - opUser = json['opUser'] != null - ? GroupMembersInfo.fromJson(json['opUser']) - : null; - changedUser = json['changedUser'] != null - ? GroupMembersInfo.fromJson(json['changedUser']) - : null; + opUser = json['opUser'] != null ? GroupMembersInfo.fromJson(json['opUser']) : null; + changedUser = json['changedUser'] != null ? GroupMembersInfo.fromJson(json['changedUser']) : null; } Map toJson() { final data = Map(); - if (this.group != null) { - data['group'] = this.group!.toJson(); + if (group != null) { + data['group'] = group!.toJson(); } - if (this.opUser != null) { - data['opUser'] = this.opUser!.toJson(); + if (opUser != null) { + data['opUser'] = opUser!.toJson(); } - if (this.changedUser != null) { - data['changedUser'] = this.changedUser!.toJson(); + if (changedUser != null) { + data['changedUser'] = changedUser!.toJson(); } return data; } @@ -707,3 +680,4 @@ class ChannelMemberInfoChangedNotification { return data; } } + diff --git a/lib/src/models/search_info.dart b/lib/src/models/search_info.dart index 0748239..70fd776 100644 --- a/lib/src/models/search_info.dart +++ b/lib/src/models/search_info.dart @@ -124,6 +124,6 @@ class SearchFriendsInfo extends FriendInfo { Map toJson() { final data = super.toJson(); data['relationship'] = this.relationship; - return data ?? {}; + return data; } } diff --git a/lib/src/models/user_info.dart b/lib/src/models/user_info.dart index 7f3e463..9145e69 100644 --- a/lib/src/models/user_info.dart +++ b/lib/src/models/user_info.dart @@ -423,3 +423,78 @@ class UserStatusInfo { return data; } } + +class GetFriendApplicationListAsRecipientReq { + final List handleResults; + final int offset; + final int count; + + GetFriendApplicationListAsRecipientReq({ + this.handleResults = const [], + required this.offset, + required this.count, + }); + + GetFriendApplicationListAsRecipientReq.fromJson(Map json) + : handleResults = json['handleResults'] == null ? [] : List.from(json['handleResults'].map((x) => x)), + offset = json['offset'], + count = json['count']; + + Map toJson() { + final data = {}; + data['handleResults'] = handleResults; + data['offset'] = offset; + data['count'] = count; + return data; + } + + @override + String toString() { + return 'GetFriendApplicationListAsRecipientReq{handleResults: $handleResults, offset: $offset, count: $count}'; + } +} + +class GetFriendApplicationListAsApplicantReq { + final int offset; + final int count; + + GetFriendApplicationListAsApplicantReq({ + required this.offset, + required this.count, + }); + + GetFriendApplicationListAsApplicantReq.fromJson(Map json) + : offset = json['offset'], + count = json['count']; + + Map toJson() { + final data = {}; + data['offset'] = offset; + data['count'] = count; + return data; + } + + @override + String toString() { + return 'GetFriendApplicationListAsApplicantReq{offset: $offset, count: $count}'; + } +} + +class GetFriendApplicationUnhandledCountReq { + final int time; + + GetFriendApplicationUnhandledCountReq({this.time = 0}); + + GetFriendApplicationUnhandledCountReq.fromJson(Map json) : time = json['time']; + + Map toJson() { + final data = {}; + data['time'] = time; + return data; + } + + @override + String toString() { + return 'GetSelfUnhandledApplyCountReq{time: $time}'; + } +} diff --git a/lib/src/openim.dart b/lib/src/openim.dart index 6bb69d8..82d932d 100644 --- a/lib/src/openim.dart +++ b/lib/src/openim.dart @@ -2,7 +2,7 @@ import 'package:flutter/services.dart'; import 'package:flutter_openim_sdk/flutter_openim_sdk.dart'; class OpenIM { - static const version = '3.8.3+2'; + static const version = '3.8.3+hotfix.10.1'; static const _channel = MethodChannel('flutter_openim_sdk'); diff --git a/pubspec.lock b/pubspec.lock index df9b838..f4bbb72 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,50 +5,50 @@ packages: dependency: transitive description: name: async - sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" url: "https://pub.dev" source: hosted - version: "2.11.0" + version: "2.13.0" boolean_selector: dependency: transitive description: name: boolean_selector - sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" characters: dependency: transitive description: name: characters - sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.4.0" clock: dependency: transitive description: name: clock - sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.1.2" collection: dependency: transitive description: name: collection - sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" url: "https://pub.dev" source: hosted - version: "1.18.0" + version: "1.19.1" fake_async: dependency: transitive description: name: fake_async - sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "1.3.3" flutter: dependency: "direct main" description: flutter @@ -63,18 +63,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" + sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0" url: "https://pub.dev" source: hosted - version: "10.0.5" + version: "10.0.9" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" + sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 url: "https://pub.dev" source: hosted - version: "3.0.5" + version: "3.0.9" leak_tracker_testing: dependency: transitive description: @@ -87,10 +87,10 @@ packages: dependency: transitive description: name: matcher - sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 url: "https://pub.dev" source: hosted - version: "0.12.16+1" + version: "0.12.17" material_color_utilities: dependency: transitive description: @@ -103,71 +103,71 @@ packages: dependency: transitive description: name: meta - sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 + sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c url: "https://pub.dev" source: hosted - version: "1.15.0" + version: "1.16.0" path: dependency: transitive description: name: path - sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" url: "https://pub.dev" source: hosted - version: "1.9.0" + version: "1.9.1" sky_engine: dependency: transitive description: flutter source: sdk - version: "0.0.99" + version: "0.0.0" source_span: dependency: transitive description: name: source_span - sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.10.1" stack_trace: dependency: transitive description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.12.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.4" string_scanner: dependency: transitive description: name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.4.1" term_glyph: dependency: transitive description: name: term_glyph - sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.2.2" test_api: dependency: transitive description: name: test_api - sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" + sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd url: "https://pub.dev" source: hosted - version: "0.7.2" + version: "0.7.4" vector_math: dependency: transitive description: @@ -180,10 +180,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" + sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02 url: "https://pub.dev" source: hosted - version: "14.2.5" + version: "15.0.0" sdks: - dart: ">=3.3.0 <4.0.0" + dart: ">=3.7.0-0 <4.0.0" flutter: ">=3.18.0-18.0.pre.54" diff --git a/pubspec.yaml b/pubspec.yaml index 5a41d7d..cae06f4 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_openim_sdk description: An instant messaging plug-in that supports Android and IOS. And the server is also all open source. -version: 3.8.3+2 +version: 3.8.3+hotfix.10.1 homepage: https://www.openim.io repository: https://github.com/openimsdk/open-im-sdk-flutter @@ -11,7 +11,7 @@ environment: dependencies: flutter: sdk: flutter - + dev_dependencies: flutter_test: sdk: flutter