pax_global_header00006660000000000000000000000064140114534200014504gustar00rootroot0000000000000052 comment=d186807accf060167a715bd6f87436c493ad9063 loqui-0.7.0/000077500000000000000000000000001401145342000126415ustar00rootroot00000000000000loqui-0.7.0/.editorconfig000066400000000000000000000002211401145342000153110ustar00rootroot00000000000000root = true [*] charset = utf-8 end_of_line = lf indent_style = tab indent_size = 8 trim_trailing_whitespace = true insert_final_newline = true loqui-0.7.0/.gitignore000066400000000000000000000071301401145342000146320ustar00rootroot00000000000000*.la *.lo *.o *~ /aclocal.m4 /autom4te.cache /config.* /configure /depcomp /install-sh /libtool /loqui-*.tar.gz /loqui.spec /ltmain.sh /missing /mkinstalldirs /stamp-h1 /compile .deps .libs Makefile Makefile.in /libloqui/Makefile.am /libloqui/loqui-account-ipmsg-private.h /libloqui/loqui-account-ipmsg.c /libloqui/loqui-account-ipmsg.h /libloqui/loqui-account-manager-private.h /libloqui/loqui-account-manager.c /libloqui/loqui-account-manager.h /libloqui/loqui-core-private.h /libloqui/loqui-core.c /libloqui/loqui-core.h /libloqui/loqui-generic-profile-factory-private.h /libloqui/loqui-generic-profile-factory.c /libloqui/loqui-generic-profile-factory.h /libloqui/loqui-message-text-private.h /libloqui/loqui-message-text-region-private.h /libloqui/loqui-message-text-region.c /libloqui/loqui-message-text-region.h /libloqui/loqui-message-text.c /libloqui/loqui-message-text.h /libloqui/loqui-mode-item-private.h /libloqui/loqui-mode-item.c /libloqui/loqui-mode-item.h /libloqui/loqui-mode-manager-private.h /libloqui/loqui-mode-manager.c /libloqui/loqui-mode-manager.h /libloqui/loqui-notifier-private.h /libloqui/loqui-notifier.c /libloqui/loqui-notifier.h /libloqui/loqui-pref-partial-private.h /libloqui/loqui-pref-partial.c /libloqui/loqui-pref-partial.h /libloqui/loqui-pref-private.h /libloqui/loqui-pref-sequence-private.h /libloqui/loqui-pref-sequence.c /libloqui/loqui-pref-sequence.h /libloqui/loqui-pref.c /libloqui/loqui-pref.h /libloqui/loqui-profile-handle-private.h /libloqui/loqui-profile-handle.c /libloqui/loqui-profile-handle.h /libloqui/loqui-property-profile-private.h /libloqui/loqui-property-profile.c /libloqui/loqui-property-profile.h /libloqui/loqui-protocol-private.h /libloqui/loqui-protocol.c /libloqui/loqui-protocol.h /libloqui/loqui-receiver-ipmsg-private.h /libloqui/loqui-receiver-ipmsg.c /libloqui/loqui-receiver-ipmsg.h /libloqui/loqui-sender-ipmsg-private.h /libloqui/loqui-sender-ipmsg.c /libloqui/loqui-sender-ipmsg.h /libloqui/loqui-socket-ipmsg-private.h /libloqui/loqui-socket-ipmsg.c /libloqui/loqui-socket-ipmsg.h /libloqui/loqui-transfer-item-irc-private.h /libloqui/loqui-transfer-item-irc.c /libloqui/loqui-transfer-item-irc.h /libloqui/loqui-transfer-item-private.h /libloqui/loqui-transfer-item.c /libloqui/loqui-transfer-item.h /libloqui/loqui_marshalers.c /libloqui/loqui_marshalers.h /libloqui/protocols/jabber/Makefile.am /libloqui/protocols/jabber/loqui-account-jabber-private.h /libloqui/protocols/jabber/loqui-account-jabber.c /libloqui/protocols/jabber/loqui-account-jabber.h /m4/libtool.m4 /m4/lt*.m4 /po/*.gmo /po/POTFILES /po/loqui.pot /src/Makefile.am /src/embedtxt/*.h /src/icons/*.h /src/loqui /src/loqui-account-dialog-private.h /src/loqui-account-dialog.c /src/loqui-account-dialog.h /src/loqui-channel-entry-action-group-private.h /src/loqui-channel-entry-action-group-ui-private.h /src/loqui-channel-entry-action-group-ui.c /src/loqui-channel-entry-action-group-ui.h /src/loqui-channel-entry-action-group.c /src/loqui-channel-entry-action-group.h /src/loqui-channel-entry-ui-data-private.h /src/loqui-channel-entry-ui-data.c /src/loqui-channel-entry-ui-data.h /src/loqui-core-gtk-private.h /src/loqui-core-gtk.c /src/loqui-core-gtk.h /src/loqui-notifier-gtk-private.h /src/loqui-notifier-gtk.c /src/loqui-notifier-gtk.h /src/loqui-protocol-selection-dialog-private.h /src/loqui-protocol-selection-dialog.c /src/loqui-protocol-selection-dialog.h /src/loqui-style-entry-private.h /src/loqui-style-entry.c /src/loqui-style-entry.h /src/loqui-transfer-window-private.h /src/loqui-transfer-window.c /src/loqui-transfer-window.h /src/loqui-tray-icon-private.h /src/loqui-tray-icon.c /src/loqui-tray-icon.h loqui-0.7.0/AUTHORS000066400000000000000000000000441401145342000137070ustar00rootroot00000000000000Yoichi Imai loqui-0.7.0/COPYING000066400000000000000000000431101401145342000136730ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. 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 this service 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. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), 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 distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the 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 a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE 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. 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 convey 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 General Public License as published by the Free Software Foundation; either version 2 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. loqui-0.7.0/COPYING.LIB000066400000000000000000000613141401145342000143060ustar00rootroot00000000000000 GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. 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 this service 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. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), 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 distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library 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 Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "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 LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY 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 LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey 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 library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA. Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! loqui-0.7.0/INSTALL000066400000000000000000000172271401145342000137030ustar00rootroot00000000000000Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. loqui-0.7.0/LICENSE000066400000000000000000000002031401145342000136410ustar00rootroot00000000000000libloqui and it's requisities (like po) distributed under LGPL (COPYING.LIB). gtk part (src/) are distributed under GPL (COPYING). loqui-0.7.0/Makefile.am000066400000000000000000000014171401145342000147000ustar00rootroot00000000000000SUBDIRS = m4 libloqui src po # test AUTOMAKE_OPTIONS = 1.5 ChangeLog: git log --name-status > $@ EXTRA_DIST= autogen.sh \ AUTHORS \ README \ NEWS \ NEWS.ja \ COPYING \ COPYING.LIB \ LICENSE \ ChangeLog \ INSTALL \ loqui.spec \ loqui.spec.in \ loqui.desktop \ loqui.png \ loqui-am-macros.m4 ACLOCAL_AMFLAGS = -I m4 icon_DATA = loqui.png icondir = $(datadir)/pixmaps desktop_DATA = loqui.desktop desktopdir = $(datadir)/applications/ dist-spec: distdir $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz sed '/^Source:/ s/\.tar\.gz$$/\.tar\.bz2/' $(distdir)/loqui.spec > $(distdir)/loqui.spec.bzip2 mv $(distdir)/loqui.spec.bzip2 $(distdir)/loqui.spec $(AMTAR) chof - $(distdir) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) loqui-0.7.0/NEWS000066400000000000000000000337251401145342000133520ustar00rootroot00000000000000--- - date: 2015-12-13 version: 0.6.4 changes: - Show the account list dialog when launching first. - Fix crashing when an account is removed. - Removed protocol selection from account settings. - Sending a message with Shift+Enter. - Removed the unnessessary "Tools" menu. - date: 2015-11-15 version: 0.6.3 changes: - Fix crashing when clicking the channel tree. - date: 2015-10-26 version: 0.6.2 changes: - Double-clicking a line in the common buffer selects the channel of message. - date: 2015-07-04 version: 0.6.1 changes: - Fixed tab completion. - date: 2015-07-04 version: 0.6.0 changes: - Fixed the bug the GlobalFont style is not applied. - Implemented nick/channel name tab completion. - date: 2013-03-18 version: 0.5.5 changes: - Improved the Japanese encoding handler for Solaris iconv (Add Japanese(ISO-2022-JP) escape sequence in the code). - date: 2013-01-27 version: 0.5.4 changes: - Fixed the bug loqui crashes on Solaris11 (Thanks to TAKI, Yasushi). - date: 2012-05-24 version: 0.5.3 changes: - Fixed bugs (See ChangeLog, or Bug #935284, #986432) - date: 2011-11-19 version: 0.5.2 changes: - Fixed bugs (See ChangeLog, or Bug #689171, #689170, #706634, #872928, #881220) - Command handler improvement (MODE/RPL_NOTOPIC). - date: 2011-02-05 version: 0.5.1 changes: - Removed gnet dependency (Now glib2 >= 2.22 is required). - Fixed the bug that loqui crashes when it received an invalid channel mode. - "(" and ")" are treated as URL. - date: 2010-12-12 version: 0.5.0 changes: - New site ("ohikkoshi") release. - Fixed some bugs. - date: 2005-10-13 version: 0.4.4 changes: - Fixed the bug that notification didn't work. - Fixed the problem that the program quit if the plum recent parser is used. - date: 2005-10-12 version: 0.4.3 changes: - Rewrote the implementation of the notification / updated-flag. - Included EggRegex (pcre + GLib wrapper). - Regular expression is supported in keywords with re: prefix.. - Created TreatAsRecentLogUntilFirstPongReceived option instead of DontMarkUntilFirstPongReceived option. - date: 2005-08-25 version: 0.4.2 changes: - The feature not to mark a channel as updated by new messages until the program received PONG at first (for some bots, optional). - Fixed the handlers of some IRC miscellaneous replies. - Reply GETINFO queries in IPMessenger. - Supports channel keys for autojoin. - Fixed the bug that the program crashes when the trayicon is right-clicked. - date: 2005-07-18 version: 0.4.1 changes: - Don't set the account buffer as the current buffer when it's connected. - Implemented the 'normal ignore' feature. - Made buildable on Cygwin/MinGW. - date: 2005-07-06 version: 0.4.0 changes: - Updated po. - date: 2005-07-03 version: 0.4.0pre4 changes: - Fixed the problem the program quits when all channels in a account are closed. - Fixed the problem to fail handling an invalid 'param' element in a account profile. - date: 2005-07-02 version: 0.4.0pre3 changes: - Changed the implementation of the management of account profiles. - Supports IP Messenger protocol (Experimental). - Fixed the problem the program doesn't update information of current channel about joined/parted. - date: 2005-05-25 version: 0.4.0pre2 changes: - Fixed the problem failed to create a rpm. - Fixed that the program segfaults when code-convertion was disabled. - date: 2005-05-15 version: 0.4.0pre1 changes: - Separated the parts not using gtk to libloqui (not completed). - Use GOB (developer only). - Use automake >= 1.5, m4 (developer only). - Use .ini (KeyFile) format for general settings. - Fixed the problem to reconnect when sent a QUIT message manually. - Rewrote the MODE parser. - Don't support gtk+-2.2 (Require gtk+-2.4). - Enabled to open an URI with a single-click. - Don't close buffers when parted a channel or closed a connection. - Fixed some UI. - Fixed some bugs. - date: 2004-09-22 version: 0.3.9 changes: - Send QUIT when the program exit. - Fixed the reconnecting flow. - Fixed the problem the other channel's topic appeared on the current channel. - date: 2004-08-26 version: 0.3.8 changes: - Large change of structure. - Fixed bugs / memory leaks. - Printing CTCP Action. - Fixed the parser of plum recent. - Fixed the timing of automatically-join. - Customizing title and statusbar with title formatting. - date: 2004-06-19 version: 0.3.7 changes: - Fixed the condition to hilight the system tray icon (whether focused or not) - Clicking the system tray icon iconify/deiconify the window. - Blink the system tray icon when the new keyword is arrived. - The feature to select a channel/account from the system tray icon. - An option whether to execute notification or not when the new keyword in the NOTICE message is arrived. - The feature to clear all unread flags of buffers. - date: 2004-06-15 version: 0.3.6 changes: - Save the configuration of accel keys at ~/.loqui/accelmaprc. - Changed accel keys for (Previous|Next)UnreadChannel from Ctrl+(Shift+)Space to Alt+Up/Down. - Save the key-event when focusing the entry. - Fixed the bug that failed to show some icons on gtk-2.4 environment. - Implemented the system tray icon (notification area). - date: 2004-05-26 version: 0.3.5 changes: - Handle informal Japanese characters(JIS X 0201 kana, 13ku-NEC special characters) - Connect with double-clicking the account node of channel tree. - date: 2004-05-13 version: 0.3.4 changes: - Sends NOTICE with Ctrl+Enter. - Fixed the context menu of the channel tree. - Added an option: "Select a new channel automatically" - Don't execute notification when a message came from server. - date: 2004-05-04 version: 0.3.3 changes: - Feature: Jump to next/previous keyword. - Set different color when the channel has normal message / notice message / keyword. - date: 2004-05-01 version: 0.3.2 changes: - Bugfix: about .spec - Bugfix: failed to remove account - Created menuitems to connect/reconnect/disconnect. - date: 2004-04-16 version: 0.3.1 changes: - Set tooltips to buttons. - Split the preference switching whether or not to scroll between channel buffer nad common buffer. - Attach menu to channel tree. - Re-fixed the bug loqui crashes when received WHO after re-joining. - date: 2004-04-09 version: 0.3.0pre4 changes: - Fixed the bug failed to save codeset. - Changed the method to manage channel buffers. - date: 2004-04-09 version: 0.3.0pre3 changes: - Fixed the bug the program quit when received WHO on the special condition. - Added icon and desktop file. - Changed the dialog for commands. - Menu changes according to the current status. - date: 2004-04-05 version: 0.3.0pre2 changes: - Fixed the bug failed to sort. - Fixed to receive SEGV when an user is parted/quit. - date: 2004-04-04 version: 0.3.0pre1 changes: - Changed the framework of the preference of accounts. - Performance improvement? - Using GtkAction. - Fixed memory-leaks. - Changed menu. - Changed the style of the channelbar. - Use current nick on the dialog to change nick. - Loop to select the next/previous channel buffer. - Changed the accel keys of next / previous channel buffer (Ctrl+Up/Down, Ctrl+Space, Ctrl+Shift+Space) - Improvement accuracy of automatic toggling scrolling. - Can specify the channel key with the dialog. - "'Channel > Part' closes private talk." - Move focus when pressed a key on the channel buffer / common buffer / nick list / channel tree. - Prevent from opening duplicated the buffer of private talk. - Added icons for away-status to the channel tree. - Made the nick list sortable. - date: 2004-03-07 version: 0.2.5 changes: - Implemented feature to save logs experimentally. - Show buffer numbers at the channel tree. - PageUp/Down scrolls the channel buffer, Alt+PageUp/Down scrolls the common buffer. - date: 2004-02-26 version: 0.2.4 changes: - Fixed some bugs. - Use the current nick as the default value of the nick-change-dialog. - Implemented short-cut keys to select a channel. - Fixed the bug failed to parse channel mode. - Changed icons of +o and +v. - date: 2004-02-08 version: 0.2.3 changes: - Fixed the bug to fail reconnect once loqui failed to connect. - Implemented command mode. - date: 2004-01-22 version: 0.2.2 changes: - Fixed the problem to handle a message that nick is used. - Implemented limitation of lines in buffers. - Show the number of updated channels. - date: 2004-01-19 version: 0.2.1 changes: - Implemented feature to fetch away information of users of a channel. - date: 2004-01-18 version: 0.2.0 changes: - Fixed some bugs. - Changed user interface(Abolished toolbar, enhanced statusbar, etc). - date: 2003-12-21 version: 0.1.20 changes: - Abolished fallbacking servers (closed Bug #13) - Handle used nick when connecting (fixed Bug #14) - Show the sender of CTCP. - Handle in case that the speaker is myself. - Fixed the problem of auto detection of the locale. - date: 2003-09-11 version: 0.1.19 changes: - Fixed some bugs. - Settings of code convertion is moved to account configuration. - Made it easy to change nick if you register nick at account configuration. - Always show idle time with WHOIS command with NickList. - Made idle time human readable. - date: 2003-07-01 version: 0.1.18 changes: - Now it preserves the current message to the history. - Changing topic is only allowed if the entry is changed. - Added Next/Prev channel button to the toolbar. - Fixed the bug that the program quits if you tried to configure accounts when they are connected. - Added the feature that all default accounts will be connected when the program started automatically. - Fixed the parser of plum-recent. - date: 2003-06-16 version: 0.1.17 changes: - Created channelbar. - Fixed the case sensitibity of RemarkEntry. - Remove needless padding of ChannelTree/NickList. - date: 2003-06-07 version: 0.1.16 changes: - Fixed the bug around the KICK message. - Added "Buffers" menu. - Added loqui.spec. - date: 2003-05-29 version: 0.1.15 changes: - Use GNet-2.0(Support IPv6?) - Parse ~/.loqui/gtkrc-2.0. - Fixed the problem loqui distinguishes #case and #CASE. - date: 2003-04-17 version: 0.1.14 changes: - Separated channel/private talk in the menus. - double-clicking nicklist make start private talk. - Transparent ignore. - date: 2003-03-26 version: 0.1.13 changes: - Fixed the bug that some messages are shown when a user that joined some channals quit/parted. - Fixed the bug the coming messages are not shown at all. - date: 2003-03-24 version: 0.1.12 changes: - Changed method to manage Account/Channel. - Supports CTCP. - date: 2003-03-17 version: 0.1.11 changes: - Stop using multi-threading in Loqui. - Enable reconnecting. - Auto-reconnect feature. - date: 2003-03-16 version: 0.1.10 changes: - Implemented multiline editing mode. - Fix the bug about threading. - date: 2003-03-16 version: 0.1.9 changes: - Support CREATIONTIME/TOPICWHOTIME reply. - Feature to parse plum-recent. - Changed saving method of highlighting words(old settings will be lost!). - History of remarks. - date: 2003-02-25 version: 0.1.8 changes: - Join/Part/Topic command with dialog. - Added new toolbar button. - date: 2003-02-23 version: 0.1.7 changes: - Connect dialog. - View menu. - Next/Previous channel. - date: 2003-02-19 version: 0.1.6 changes: - Implemented Cut/Copy/Paste - Fix scrollbar behavior. - Function to determine whether scrolling or not with scrollbar operation. - date: 2003-02-19 version: 0.1.5 changes: - Replaced emphasis with highlight. - Fix the high load when selected a channel. - Show channel modes. - date: 2003-02-16 version: 0.1.4 changes: - Autojoin feature. - Notification feature. - Clickable URL. - Common Preferences dialog. - date: 2003-02-12 version: 0.1.3 changes: - Change the charset of .po file into UTF-8 - Change implementation of prefs_general(data saved in loquirc.xml will be lost.) - Popup menu of NickList is implemented. - date: 2003-02-10 version: 0.1.2 changes: - Fix the bug the program quits when it received a QUIT message that doesn't contain no parameters. - New code convertion method. - Enabled translation of menu. - date: 2003-02-08 version: 0.1.1 changes: - Changed interface. - Fix a bug to fail sending a message that contains no parameters. - Implemented a feature to toggle home/away. - date: 2003-01-27 version: 0.1.0 changes: - Created account settings. - Fix the bug blocking when disconnecting. - Enabled nicklist sorting. - date: 2003-01-23 version: 0.0.9 changes: - Fix the bug a connection is terminated when failed to convert codeset. - Change color of the channel on the channel tree when new messages are arrived. - date: 2003-01-19 version: 0.0.8 changes: - Changed the way to change buffers/userlists. - Saving channel tree/common buffer size. - date: 2003-01-19 version: 0.0.7 changes: - Fixed a bug sometimes nicklist is broken by user's part/quit. - Improved performance of scrolling - Removed dependency of GConf/GNOME2 - date: 2003-01-10 version: 0.0.6 changes: - Fixed a incorrect handling with a private message. - Fixed some small bugs. - date: 2003-01-09 version: 0.0.5 changes: - First release. loqui-0.7.0/NEWS.ja000066400000000000000000000410451401145342000137350ustar00rootroot00000000000000--- - date: 2015-12-13 version: 0.6.4 changes: - åˆå›žèµ·å‹•時ã«ã‚¢ã‚«ã‚¦ãƒ³ãƒˆè¨­å®šãƒ€ã‚¤ã‚¢ãƒ­ã‚°ã‚’表示 - アカウント削除時ã«ã‚¯ãƒ©ãƒƒã‚·ãƒ¥ã™ã‚‹ãƒã‚°ã®ä¿®æ­£ - アカウント設定ã‹ã‚‰ãƒ—ãƒ­ãƒˆã‚³ãƒ«é¸æŠžã®å‰Šé™¤ - Shift+Enterã§é€ä¿¡ã™ã‚‹æ©Ÿèƒ½ã®è¿½åŠ  - ä¸è¦ãªã€Œãƒ„ールã€ãƒ¡ãƒ‹ãƒ¥ãƒ¼ã®å‰Šé™¤ - date: 2015-11-15 version: 0.6.3 changes: - ãƒãƒ£ãƒ³ãƒãƒ«ãƒ„リーをクリック時ã«ã‚¯ãƒ©ãƒƒã‚·ãƒ¥ã™ã‚‹ãƒã‚°ã®ä¿®æ­£ - date: 2015-10-26 version: 0.6.2 changes: - 共通ãƒãƒƒãƒ•ã‚¡ã®ãƒ€ãƒ–ルクリックã§ãƒãƒ£ãƒ³ãƒãƒ«ã‚’é¸æŠžã™ã‚‹æ©Ÿèƒ½ã®è¿½åŠ  - date: 2015-07-04 version: 0.6.1 changes: - タブ補完ã®ä¿®æ­£ - date: 2015-07-04 version: 0.6.0 changes: - GlobalFontスタイルãŒé©ç”¨ã•れãªã„ãƒã‚°ã®ä¿®æ­£ - Nick/ãƒãƒ£ãƒ³ãƒãƒ«åã®ã‚¿ãƒ–補完ã®å®Ÿè£… - date: 2013-03-18 version: 0.5.5 changes: - Solaris iconvå‘ã‘æ—¥æœ¬èªžå‡¦ç†æ”¹å–„("Japanese"ã§ã®é€ä¿¡æ™‚ã®ISO-2022-JPエスケープシーケンス付与処ç†ã‚’自å‰å®Ÿè£…) - date: 2012-01-27 version: 0.5.4 changes: - Solaris11ã§ã‚¯ãƒ©ãƒƒã‚·ãƒ¥ã™ã‚‹ãƒã‚°ã®ä¿®æ­£ (Thanks to TAKI, Yasushi) - date: 2012-05-24 version: 0.5.3 changes: - ãƒã‚°ä¿®æ­£ (See ChangeLog, or Bug #935284, #986432) - date: 2011-11-19 version: 0.5.2 changes: - ãƒã‚°ä¿®æ­£ (See ChangeLog, or Bug #689171, #689170, #706634, #872928, #881220) - コマンドãƒãƒ³ãƒ‰ãƒ©ã®å¼·åŒ– (MODE/RPL_NOTOPIC). - date: 2011-02-05 version: 0.5.1 changes: - GNetä¾å­˜ã‚’削除 (glib2 >= 2.22ãŒå¿…è¦)。 - 䏿­£ãªãƒãƒ£ãƒ³ãƒãƒ«ãƒ¢ãƒ¼ãƒ‰ã‚’å—ã‘å–ã£ãŸéš›ã«è½ã¡ã‚‹å•題を修正。 - "("ã¨")"ã‚’URLã¨ã—ã¦æ‰±ã†ã‚ˆã†ã«ã—ãŸã€‚ - date: 2010-12-12 version: 0.5.0 changes: - 新サイトãŠå¼•è¶Šã—リリース。 - ã„ãã¤ã‹ã®ãƒã‚°ã‚’修正。 - date: 2005-10-13 version: 0.4.4 changes: - 通知ãŒå‹•ã‹ãªã„å•題ã®ä¿®æ­£ã€‚ - plumã®recent parserを使ã†ã¨è½ã¡ã‚‹å•題ã®ä¿®æ­£ã€‚ - date: 2005-10-12 version: 0.4.3 changes: - 通知/æ–°ç€ã¾ã‚ã‚Šã®æ›¸ãç›´ã—。 - EggRegex (pcre + GLib wrapper) ã®åŒæ¢±ã€‚ - re:接頭辞をã¤ã‘ã‚‹ã“ã¨ã§ã‚­ãƒ¼ãƒ¯ãƒ¼ãƒ‰ã«æ­£è¦è¡¨ç¾ã‚’利用å¯èƒ½ã«ã—ãŸã€‚ - TreatAsRecentLogUntilFirstPongReceivedオプションをDontMarkUntilFirstPongReceivedオプションã®ä»£ã‚りã«è¿½åŠ ã€‚ - date: 2005-08-25 version: 0.4.2 changes: - æ–°ã—ã„ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ãŒæ¥ã¦ã‚‚最åˆã®PONGãŒæ¥ã‚‹ã¾ã§updatedã¨ã—ãªã„機能ã®è¿½åŠ (ã„ãã¤ã‹ã®ãƒœãƒƒãƒˆç”¨, ä»»æ„) - IRCã®ç´°ã‹ãªãƒªãƒ—ãƒ©ã‚¤ã®æ‰±ã„ã®ä¿®æ­£ã€‚ - IPMessengerã§GETINFOã‚’è¿”ã™ã‚ˆã†ã«ã—ãŸã€‚ - 自動join機能ã§ã®ãƒãƒ£ãƒ³ãƒãƒ«ã‚­ãƒ¼ã®ã‚µãƒãƒ¼ãƒˆã€‚ - トレイアイコンをå³ã‚¯ãƒªãƒƒã‚¯ã—ãŸã¨ãã«è½ã¡ã‚‹å•題ã®ä¿®æ­£ã€‚ - date: 2005-07-18 version: 0.4.1 changes: - 接続時ã«ã‚¢ã‚«ã‚¦ãƒ³ãƒˆãƒãƒƒãƒ•ã‚¡ã‚’é¸æŠžã—ãªã„よã†ã«ä¿®æ­£ã€‚ - 通常ã®ignore機能を実装。 - Cygwin/MinGWã§ãƒ“ルドã§ãるよã†ã«ã—ãŸã€‚ - date: 2005-07-06 version: 0.4.0 changes: - poを更新。 - date: 2005-07-03 version: 0.4.0pre4 changes: - ã™ã¹ã¦ã®ãƒãƒ£ãƒ³ãƒãƒ«ã‚’é–‰ã˜ã‚‹ã¨è½ã¡ã‚‹å•題ã®ä¿®æ­£ã€‚ - アカウント設定内ã®ä¸æ­£ãª'param'è¦ç´ ã®æ‰±ã„ã«å¤±æ•—ã™ã‚‹å•題ã®ä¿®æ­£ã€‚ - date: 2005-07-02 version: 0.4.0pre3 changes: - アカウント設定ファイルã®ç®¡ç†æ–¹æ³•ã®å¤§å¹…変更。 - IP Messengerプロトコルã®ã‚µãƒãƒ¼ãƒˆ(実験的)。 - ãƒãƒ£ãƒ³ãƒãƒ«ã‚’é¸æŠžã—ç›´ã•ãªã„ã¨joinedæƒ…å ±ãŒæ›´æ–°ã•れãªã„å•題ã®ä¿®æ­£ã€‚ - date: 2005-05-25 version: 0.4.0pre2 changes: - rpmãŒä½œæˆã§ããªã„å•題を修正。 - コード変æ›ç„¡åŠ¹æ™‚ã«segfaultã™ã‚‹å•題ã®ä¿®æ­£ã€‚ - date: 2005-05-15 version: 0.4.0pre1 changes: - éžGtk部分をlibloquiã¨ã—ã¦åˆ†é›¢ã€‚ (ä¸å®Œå…¨) - GOBã®åˆ©ç”¨ã€‚(開発者ã®ã¿) - automake >= 1.5, m4 ã®åˆ©ç”¨ (開発者ã®ã¿) - 一般設定ã®.iniå½¢å¼åŒ–。 - QUITを手動é€ä¿¡æ™‚ã«å†æŽ¥ç¶šã—ã¦ã—ã¾ã†å•題ã®ä¿®æ­£ã€‚ - MODE parserã®ä¸€æ–°ã€‚ - Gtk+-2.2サãƒãƒ¼ãƒˆã®ä¸­æ­¢ (2.4ãŒå¿…é ˆã«) - URIをシングルクリックã§é–‹ã‘るよã†ã«ã—ãŸã€‚ - ãƒãƒ£ãƒ³ãƒãƒ«ã‚’抜ã‘ãŸã‚Šåˆ‡æ–­ã—ãŸã‚Šã—ã¦ã‚‚ãƒãƒƒãƒ•ã‚¡ã‚’é–‰ã˜ãªã„よã†ã«ã—ãŸã€‚ - ç´°ã‹ã„UIã®ä¿®æ­£ã€‚ - ç´°ã‹ã„ãƒã‚°ã®ä¿®æ­£ã€‚ - date: 2004-09-22 version: 0.3.9 changes: - プログラム終了時ã«QUITã‚’é€ä¿¡ã™ã‚‹ã‚ˆã†ã«ã—ãŸã€‚ - å†æŽ¥ç¶šå‡¦ç†ã‚’修正ã—ãŸã€‚ - ä»–ã®ãƒãƒ£ãƒ³ãƒãƒ«ã®topicãŒç¾åœ¨ã®ãƒãƒ£ãƒ³ãƒãƒ«ã«ç¾ã‚Œã¦ã—ã¾ã†å•題を修正ã—ãŸã€‚ - date: 2004-08-26 version: 0.3.8 changes: - 構造ã®å¤§å¹…変更。 - メモリリーク / ãƒã‚°ã®ä¿®æ­£ã€‚ - CTCP Actionã®è¡¨ç¤ºã€‚ - plum recent パーサã®ä¿®æ­£ã€‚ - 自動Joinã®ã‚¿ã‚¤ãƒŸãƒ³ã‚°ã®ä¿®æ­£ã€‚ - title formattingã«ã‚ˆã£ã¦ã‚¿ã‚¤ãƒˆãƒ«ã¨ã‚¹ãƒ†ãƒ¼ã‚¿ã‚¹ãƒãƒ¼ãŒã‚«ã‚¹ã‚¿ãƒžã‚¤ã‚ºã§ãるよã†ã«ã—ãŸã€‚ - date: 2004-06-19 version: 0.3.7 changes: - システムトレイアイコンをãƒã‚¤ãƒ©ã‚¤ãƒˆã™ã‚‹æ¡ä»¶ã®ä¿®æ­£(フォーカスã—ã¦ã„ã‚‹ã‹ã©ã†ã‹)。 - システムトレイアイコンをクリックã§ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã‚’アイコン化/éžã‚¢ã‚¤ã‚³ãƒ³åŒ–ã§ãるよã†ã«ã—ãŸã€‚ - ã‚­ãƒ¼ãƒ¯ãƒ¼ãƒ‰ãŒæ¥ãŸã‚‰ã‚·ã‚¹ãƒ†ãƒ ãƒˆãƒ¬ã‚¤ã‚¢ã‚¤ã‚³ãƒ³ã‚’点滅ã™ã‚‹ã‚ˆã†ã«ã—ãŸã€‚ - ãƒãƒ£ãƒ³ãƒãƒ«/アカウントをシステムトレイアイコンã‹ã‚‰é¸æŠžã§ãるよã†ã«ã—ãŸã€‚ - NOTICEã§ã‚­ãƒ¼ãƒ¯ãƒ¼ãƒ‰ãŒå«ã¾ã‚Œã¦ã„ãŸå ´åˆã«ã‚µã‚¦ãƒ³ãƒ‰ã‚’鳴らã™ã‹è¨­å®šã§ãるよã†ã«ã—ãŸã€‚ - ã™ã¹ã¦ã®ãƒãƒƒãƒ•ã‚¡ã®æœªèª­ãƒ•ラグをクリアã™ã‚‹æ©Ÿèƒ½ã‚’ã¤ã‘ãŸã€‚ - date: 2004-06-15 version: 0.3.6 changes: - ショートカットキーã®è¨­å®šã‚’~/.loqui/accelmaprcã«ä¿å­˜ã™ã‚‹ã‚ˆã†ã«ã—ãŸã€‚ - (å‰|次)ã®æœªèª­ãƒãƒ£ãƒ³ãƒãƒ«ã®ã‚·ãƒ§ãƒ¼ãƒˆã‚«ãƒƒãƒˆã‚­ãƒ¼ã‚’Ctrl+(Shift+)Spaceã‹ã‚‰Alt+Up/Downã«å¤‰æ›´ã€‚ - entryをフォーカスã™ã‚‹ã¨ãキーイベントをä¿å­˜ã™ã‚‹ã‚ˆã†ã«ä¿®æ­£ã€‚ - gtk-2.4環境ã§ã„ãã¤ã‹ã®ã‚¢ã‚¤ã‚³ãƒ³ãŒè¡¨ç¤ºã•れãªã„ãƒã‚°ã®ä¿®æ­£ã€‚ - システムトレイアイコン(notification area)ã®å®Ÿè£…。 - date: 2004-05-26 version: 0.3.5 changes: - éžå…¬å¼ãªæ—¥æœ¬èªžæ–‡å­—列(JIS X 0201 カナ, 13区NEC特殊文字)を扱ãˆã‚‹ã‚ˆã†ã«ã—ãŸã€‚ - ãƒãƒ£ãƒ³ãƒãƒ«ãƒ„リーã®ã‚¢ã‚«ã‚¦ãƒ³ãƒˆã‚’ãƒ€ãƒ–ãƒ«ã‚¯ãƒªãƒƒã‚¯ã§æŽ¥ç¶šã§ãるよã†ã«ã—ãŸã€‚ - date: 2004-05-13 version: 0.3.4 changes: - Ctrl+Enterã§NOTICEã‚’é€ä¿¡ã§ãるよã†ã«ã—ãŸã€‚ - ChannelTreeã®ã‚³ãƒ³ãƒ†ã‚­ã‚¹ãƒˆãƒ¡ãƒ‹ãƒ¥ãƒ¼ã‚’修正。 - JOIN時ã«ãƒ•ォーカスを移動ã—ãªã„設定を追加。 - サーãƒã‹ã‚‰ã®ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ã§é€šçŸ¥ã‚’実行ã—ãªã„よã†ã«å¤‰æ›´ã€‚ - date: 2004-05-04 version: 0.3.3 changes: - 次/å‰ã®ã‚­ãƒ¼ãƒ¯ãƒ¼ãƒ‰ã«é£›ã¶æ©Ÿèƒ½ã‚’実装。 - 普通ã®ç™ºè¨€/NOTICE/キーワードã§Channelを色分ã‘ã™ã‚‹ã‚ˆã†ã«ã—ãŸã€‚ - date: 2004-05-01 version: 0.3.2 changes: - rpmãŒä½œæˆã§ããªã„å•題を修正。 - アカウントã®å‰Šé™¤ãŒã†ã¾ãã„ã‹ãªã„å•題を修正。 - 接続/å†æŽ¥ç¶š/切断ã®ãƒ¡ãƒ‹ãƒ¥ãƒ¼ã‚’作æˆã€‚ - date: 2004-04-16 version: 0.3.1 changes: - ボタンã«ãƒ„ールãƒãƒƒãƒ—ã‚’ã¤ã‘ãŸã€‚ - ãƒãƒ£ãƒ³ãƒãƒ«ãƒãƒƒãƒ•ã‚¡ã¨å…±é€šãƒãƒƒãƒ•ã‚¡ã®è‡ªå‹•スクロール設定を分離ã—ãŸã€‚ - ãƒãƒ£ãƒ³ãƒãƒ«ãƒ„リーã«ãƒ¡ãƒ‹ãƒ¥ãƒ¼ã‚’ã¤ã‘ãŸã€‚ - å†join後ã«WHOã‚’å—ä¿¡ã™ã‚‹ã¨è½ã¡ã‚‹ãƒã‚°ã‚’å†ä¿®æ­£ã€‚ - date: 2004-04-09 version: 0.3.0pre4 changes: - Codeset設定ãŒãŠã‹ã—ã„å•題を修正。 - ãƒãƒƒãƒ•ã‚¡ã®ç®¡ç†æ–¹æ³•ã®å¤‰æ›´ã€‚ - date: 2004-04-09 version: 0.3.0pre3 changes: - WHOã‚’å—ä¿¡ã—ãŸæ™‚æ¡ä»¶ã«ã‚ˆã£ã¦ã¯è½ã¡ã‚‹ãƒã‚°ã‚’修正。 - アイコンã¨ãƒ‡ã‚¹ã‚¯ãƒˆãƒƒãƒ—ファイルを追加。 - コマンド用ã®ãƒ€ã‚¤ã‚¢ãƒ­ã‚°ã‚’修正。 - メニューãŒçжæ³ã«å¿œã˜ã¦å¤‰ã‚るよã†ã«ã—ãŸã€‚ - date: 2004-04-05 version: 0.3.0pre2 changes: - ソートã®ä¸å…·åˆã‚’修正。 - part/quit時ã«è½ã¡ã‚‹å•題ã®ä¿®æ­£ã€‚ - date: 2004-04-04 version: 0.3.0pre1 changes: - アカウント設定ã®ä»•組ã¿ã‚’変更(設定ã¯å¤±ã‚れã¾ã™) - パフォーマンスã®å‘上? - GtkActionを使ã†ã‚ˆã†ã«ã—ãŸã€‚ - メモリリークã®ä¿®æ­£ã€‚ - メニューã®å¤‰æ›´ã€‚ - ãƒãƒ£ãƒ³ãƒãƒ«ãƒãƒ¼ã®ã‚¹ã‚¿ã‚¤ãƒ«ã®å¤‰æ›´ã€‚ - Nick変更ダイアログã§ç¾åœ¨ã®Nickを使ã†ã‚ˆã†ã«ã—ãŸã€‚ - 次/å‰ã®ãƒãƒ£ãƒ³ãƒãƒ«ãƒãƒƒãƒ•ã‚¡ã§1周ã™ã‚‹ã‚ˆã†ã«ã—ãŸã€‚ - 次/å‰ã®ãƒãƒ£ãƒ³ãƒãƒ«ãƒãƒƒãƒ•ã‚¡ã®ã‚­ãƒ¼ã®å¤‰æ›´(Ctrl+Up/Down, Ctrl+Space, Ctrl+Shift+Space) - 自動スクロール切り替ãˆã®ç²¾åº¦ã®å‘上。 - Joinダイアログã§keyを指定ã§ãるよã†ã«ã—ãŸã€‚ - Partã§ãƒ—ライベートトークを閉ã˜ã‚‰ã‚Œã‚‹ã‚ˆã†ã«ã—ãŸã€‚ - ãƒãƒ£ãƒ³ãƒãƒ«ãƒãƒƒãƒ•ã‚¡/共通ãƒãƒƒãƒ•ã‚¡/Nickリスト/ãƒãƒ£ãƒ³ãƒãƒ«ãƒ„リーã§ã‚­ãƒ¼ãŒå…¥åŠ›ã•れãŸã¨ã発言エントリã«ãƒ•ォーカスを移動ã™ã‚‹ã‚ˆã†ã«ã—ãŸã€‚ - 2é‡ã«ãƒ—ライベートトークãƒãƒƒãƒ•ã‚¡ã‚’é–‹ã‹ãªã„よã†ã«ã—ãŸã€‚ - ãƒãƒ£ãƒ³ãƒãƒ«ãƒ„リーã«é›¢å¸­ã‚¢ã‚¤ã‚³ãƒ³ã‚’追加ã—ãŸã€‚ - Nickリストをソートã§ãるよã†ã«ã—ãŸã€‚ - date: 2004-03-07 version: 0.2.5 changes: - ログをå–る機能を実験的ã«å®Ÿè£…ã—ãŸã€‚ - ãƒãƒ£ãƒ³ãƒãƒ«ãƒ„リーã«ãƒãƒƒãƒ•ァ番å·ã‚’ã¤ã‘ãŸã€‚ - PageUp/PageDownã§ãƒãƒ£ãƒ³ãƒãƒ«ãƒãƒƒãƒ•ã‚¡ã‚’ã€Alt+PageUp/PageDownã§å…±é€šãƒãƒƒãƒ•ァをスクロールã™ã‚‹ã‚ˆã†ã«ã—ãŸã€‚ - date: 2004-02-26 version: 0.2.4 changes: - ã„ãã¤ã‹ã®ãƒã‚°ã®ä¿®æ­£ã€‚ - nick変更ダイアログã®ãƒ‡ãƒ•ォルトã«ç¾åœ¨ã®nickを使ã†ã‚ˆã†ã«ã—ãŸã€‚ - ãƒãƒ£ãƒ³ãƒãƒ«é¸æŠžã®ã‚·ãƒ§ãƒ¼ãƒˆã‚«ãƒƒãƒˆã‚­ãƒ¼(Ctrl+[0-9], Alt+[0-9])を実験的ã«å®Ÿè£…ã—ãŸã€‚ - ãƒãƒ£ãƒ³ãƒãƒ«ãƒ¢ãƒ¼ãƒ‰ã®parseã«å¤±æ•—ã™ã‚‹ãƒã‚°ã‚’修正ã—ãŸã€‚ - +oã¨+vã®ã‚¢ã‚¤ã‚³ãƒ³ã‚’変更ã—ãŸã€‚ - date: 2004-02-08 version: 0.2.3 changes: - 接続ã«å¤±æ•—ã™ã‚‹ã¨å†æŽ¥ç¶šã§ããªã„ãƒã‚°ã‚’修正。 - コマンドモードを実装。 - date: 2004-01-22 version: 0.2.2 changes: - 接続時ã®nickã®é‡è¤‡ã¸ã®å¯¾å¿œã«å•題ãŒã‚ã£ãŸã®ã‚’修正。 - ãƒãƒƒãƒ•ã‚¡ã®è¡Œæ•°åˆ¶é™ã«å¯¾å¿œã€‚ - ステータスãƒãƒ¼ã«æœªèª­ãƒãƒ£ãƒ³ãƒãƒ«æ•°ã‚’表示。 - date: 2004-01-19 version: 0.2.1 changes: - ãƒãƒ£ãƒ³ãƒãƒ«å†…ユーザã®Away情報を表示ã§ãるよã†ã«ã—ãŸã€‚ - date: 2004-01-18 version: 0.2.0 changes: - ã„ãã¤ã‹ã®ãƒã‚°ã®ä¿®æ­£ã€‚ - ユーザインタフェースã®å¤‰æ›´(ツールãƒãƒ¼ã®å»ƒæ­¢ã€ã‚¹ãƒ†ãƒ¼ã‚¿ã‚¹ãƒãƒ¼ã®å¼·åŒ–, etc) - date: 2003-12-21 version: 0.1.20 changes: - サーãƒã®fallbackを廃止(closed Bug #13) - 接続時ã«nickãŒé‡è¤‡ã—ã¦ã„ãŸå ´åˆã¸ã®ä»®å¯¾å¿œ(fixed Bug #14) - CTCPã®é€ä¿¡å…ƒã‚’表示。 - 発言者ãŒè‡ªåˆ†ã®å ´åˆã«å¯¾å¿œã€‚ - ロケールã®è‡ªå‹•判別ã®ä¸å…·åˆã‚’修正。 - date: 2003-09-11 version: 0.1.19 changes: - ã„ãã¤ã‹ã®ãƒã‚°ã‚’修正。 - コード変æ›è¨­å®šã‚’アカウント設定ã«ç§»å‹•。 - よã使ã†Nickをアカウント設定ã§ç™»éŒ²ã™ã‚‹ã¨Nickã‚’ç°¡å˜ã«å¤‰æ›´ã§ãる機能を追加。 - NickListã‹ã‚‰WHOISã—ãŸã¨ã常ã«Idle timeを表示ã™ã‚‹ã‚ˆã†ã«ã—ãŸã€‚ - Idle timeを読ã¿ã‚„ã™ã„よã†ã«ã—ãŸã€‚ - date: 2003-07-01 version: 0.1.18 changes: - ç¾åœ¨å…¥åЛ䏭ã®ç™ºè¨€ã‚‚ヒストリã«ä¿æŒã§ãるよã†ã«ãªã£ãŸã€‚ - エントリãŒå¤‰æ›´ã•れãŸã¨ãã®ã¿TopicãŒå¤‰æ›´ã§ãるよã†ã«ãªã£ãŸã€‚ - Next/Prev Channelボタンをツールãƒãƒ¼ã«è¿½åŠ ã€‚ - 接続中ã«ã‚¢ã‚«ã‚¦ãƒ³ãƒˆè¨­å®šã‚’変更ã—よã†ã¨ã™ã‚‹ã¨è½ã¡ã‚‹ãƒã‚°ã‚’修正。 - 起動時ã«è‡ªå‹•接続を実装。 - plumã®recentメッセージã®parseを厳ã—ãã—ãŸã€‚ - date: 2003-06-16 version: 0.1.17 changes: - ãƒãƒ£ãƒ³ãƒãƒ«ãƒãƒ¼ã‚’作æˆã€‚ - 発言エントリã§å¤§æ–‡å­—/å°æ–‡å­—を区別ã›ãšè£œå®Œã—ã¦ã—ã¾ã†ãƒã‚°ã‚’修正。 - ChannelTree/NickListã®ä½™è¨ˆãªç©ºç™½ã‚’除去。 - date: 2003-06-07 version: 0.1.16 changes: - KICKã—ãŸã¨ãã®æŒ™å‹•ãŒãŠã‹ã—ã„ã®ã‚’修正。 - ãƒãƒƒãƒ•ã‚¡ メニューをã¤ã‘ãŸã€‚ - loqui.specを添付ã—ãŸã€‚ - date: 2003-05-29 version: 0.1.15 changes: - GNet-2.0を採用(IPv6ã«å¯¾å¿œï¼Ÿ) - ~/.loqui/gtkrc-2.0ã‚’parseã™ã‚‹ã‚ˆã†ã«ã—ãŸã€‚ - ãƒãƒ£ãƒ³ãƒãƒ«åã®å¤§æ–‡å­—/å°æ–‡å­—を区別ã—ã¦ã—ã¾ã†å•題(Bug #2)を修正。 - date: 2003-04-17 version: 0.1.14 changes: - メニューã§ã¯ãƒãƒ£ãƒ³ãƒãƒ«ã¨ãƒ—ライベートトークを区別ã™ã‚‹ã‚ˆã†ã«ã—ãŸã€‚ - ニックリストã®ãƒ€ãƒ–ルクリックã§ãƒ—ライベートトークを開始。 - 逿˜Žignoreã®å®Ÿè£…。 - date: 2003-03-26 version: 0.1.13 changes: - åŒã˜äººãŒè¤‡æ•°ã®ãƒãƒ£ãƒ³ãƒãƒ«ã«å‚加ã—ã¦ã„ãŸã¨ãpart/quitã™ã‚‹ã¨ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ãŒå¢—ãˆã¦ã—ã¾ã†ãƒã‚°ã‚’修正。 - é€ã‚‰ã‚Œã¦ããŸç™ºè¨€ãŒå…¨ã見ãˆãªã„ãƒã‚°ã‚’修正。 - date: 2003-03-24 version: 0.1.12 changes: - Account/Channelã®ç®¡ç†æ–¹æ³•ã®å¤‰æ›´ã€‚ - CTCPã«å¯¾å¿œã€‚ - date: 2003-03-18 version: 0.1.11 changes: - Loqui内部ã§ã®ãƒžãƒ«ãƒã‚¹ãƒ¬ãƒƒãƒ‰ã‚’ã‚„ã‚ãŸã€‚ - å†æŽ¥ç¶šãŒå¯èƒ½ã«ãªã£ãŸ(Bug #1)。 - è‡ªå‹•å†æŽ¥ç¶šãŒå¯èƒ½ã«ãªã£ãŸ(未テスト)。 - date: 2003-03-16 version: 0.1.10 changes: - 複数行発言モードを実装 - スレッドã«é–¢ã™ã‚‹å•題ã®ä¿®æ­£ - date: 2003-03-16 version: 0.1.9 changes: - CREATIONTIME/TOPICWHOTIMEリプライã«å¯¾å¿œã€‚ - plum-recentを読むã“ã¨ãŒå¯èƒ½ã«ãªã£ãŸã€‚ - å応å˜èªžã®ä¿å­˜æ–¹æ³•を変更(今ã¾ã§ã®è¨­å®šã¯å¤±ã‚れã¾ã™)。 - 発言ã®å±¥æ­´ã€‚ - date: 2003-02-25 version: 0.1.8 changes: - Join/Part/Topicダイアログ - Next/Prevボタン - date: 2003-02-23 version: 0.1.7 changes: - 接続ダイアログ - 表示メニュー - Next/Previous channel - date: 2003-02-19 version: 0.1.6 changes: - Cut/Copy/Pasteを実装 - スクロールãƒãƒ¼ã®æŒ™å‹•を修正 - スクロールã®è‡ªå‹•オン/オフを実装 - date: 2003-02-19 version: 0.1.5 changes: - emphasisã‚’highlightã«ã—ãŸã€‚ - ãƒãƒ£ãƒ³ãƒãƒ«ã‚’é¸æŠžã™ã‚‹ã¨é«˜è² è·ã«ãªã‚‹ãƒã‚°ã‚’修正 - ãƒãƒ£ãƒ³ãƒãƒ«ãƒ¢ãƒ¼ãƒ‰ã‚’表示ã§ãるよã†ã«ã—ãŸã€‚ - date: 2003-02-16 version: 0.1.4 changes: - 自動Join機能 - 通知機能 - クリッカブルURL - 設定ダイアログã®å®Ÿè£… - date: 2003-02-12 version: 0.1.3 changes: - .poã®æ–‡å­—コードをUTF-8ã«ã—ãŸã€‚ - prefs_generalã®å®Ÿè£…を変ãˆãŸ(loquirc.xmlã«ä¿å­˜ã•れã¦ã„る情報ã¯å¤±ã‚れã¾ã™)。 - NickListã®ãƒãƒƒãƒ—アップメニューを作æˆã—ã¾ã—ãŸã€‚ - date: 2003-02-10 version: 0.1.2 changes: - パラメータã®ãªã„QUITコマンドをå—ã‘ã‚‹ã¨è½ã¡ã‚‹ãƒã‚°ã‚’修正。 - æ–‡å­—ã‚³ãƒ¼ãƒ‰å¤‰æ›æ–¹æ³•を変更。 - メニューã®ç¿»è¨³ã‚’有効ã«ã—ãŸã€‚ - date: 2003-02-08 version: 0.1.1 changes: - パラメータã®ãªã„メッセージãŒé€ã‚Œãªã„ãƒã‚°ã‚’修正。 - インタフェースを変更。 - Away機能ã®å®Ÿè£…。 - date: 2003-01-27 version: 0.1.0 changes: - アカウント設定ダイアログを実装。 - 接続切断時ã«ãƒ–ロックã—ã¦ã—ã¾ã†ãƒã‚°ã‚’修正。 - Nicklistをソートã§ãるよã†ã«ã—ãŸã€‚ - date: 2003-01-23 version: 0.0.9 changes: - æ–°ã—ã„ç™ºè¨€ãŒæ¥ãŸã¨ããƒãƒ£ãƒ³ãƒãƒ«ã®è‰²ã‚’変ãˆã‚‹ã‚ˆã†ã«ã—ãŸã€‚ - 文字コード変æ›ã«å¤±æ•—ã™ã‚‹ã¨æŽ¥ç¶šãŒåˆ‡æ–­ã•れã¦ã—ã¾ã†ãƒã‚°ã‚’修正。 - date: 2003-01-19 version: 0.0.8 changes: - ãƒãƒƒãƒ•ã‚¡ã¨ãƒ¦ãƒ¼ã‚¶ãƒªã‚¹ãƒˆã®åˆ‡ã‚Šæ›¿ãˆæ–¹æ³•ã®å¤‰æ›´(高速化)。 - ãƒãƒ£ãƒ³ãƒãƒ«ãƒ„リーã¨å…±é€šãƒãƒƒãƒ•ã‚¡ã®ã‚µã‚¤ã‚ºã‚’記録ã™ã‚‹ã‚ˆã†ã«ã—ãŸã€‚ - date: 2003-01-19 version: 0.0.7 changes: - PART/QUIT時ã«NickListãŒå£Šã‚Œã¦ã—ã¾ã†å ´åˆãŒã‚ã‚‹ã®ã‚’修正(ãŸã¶ã‚“)。 - スクロールã®ãƒ‘フォーマンスをå‘上。 - GConf/GNOME2ä¾å­˜ã‚’ç„¡ãã—ãŸã€‚ - date: 2003-01-12 version: 0.0.6 changes: - privã®æ‰±ã„ã®ä¿®æ­£ã€‚ - ã„ãã¤ã‹ã®ãƒã‚°ã‚’修正。 - date: 2003-01-10 version: 0.0.5 changes: - 最åˆã®ãƒªãƒªãƒ¼ã‚¹ã€‚ loqui-0.7.0/README000066400000000000000000000006221401145342000135210ustar00rootroot00000000000000Loqui -- IRC/Chat client for Gtk ================================= What's this? ------------ Loqui is an IRC/Chat client for a Gtk environment. Features -------- - Supports multiple servers. - Supports multiple protocols (IRC, IP Messenger (Experimental)). - The common buffer (a buffer to show messages on the channels that not currently selected). How to install? --------------- See INSTALL. loqui-0.7.0/autogen.sh000077500000000000000000000007501401145342000146440ustar00rootroot00000000000000#!/bin/sh M4_MAKEFILE_AM_FILES="libloqui/protocols/jabber/Makefile.am libloqui/Makefile.am src/Makefile.am" set -e # pushd test # ./update-makefile.sh # popd rm -f ChangeLog if type gob2 >/dev/null 2>&1; then : else echo gob2 is not installed. exit 1 fi aclocal -I m4 glib-gettextize --force --copy libtoolize --force --copy autoheader for i in $M4_MAKEFILE_AM_FILES; do m4 -I. "$i.m4" > "$i" done automake --add-missing --foreign --copy autoconf ./configure "$@" loqui-0.7.0/configure.ac000066400000000000000000000040571401145342000151350ustar00rootroot00000000000000# -*- Autoconf -*- AC_PREREQ(2.53) m4_define([loqui_major_version], [0]) m4_define([loqui_minor_version], [7]) m4_define([loqui_micro_version], [0]) m4_define([loqui_extra_version], []) m4_define([loqui_version], [loqui_major_version.loqui_minor_version.loqui_micro_version[]loqui_extra_version]) AC_INIT(loqui, loqui_version) AC_CONFIG_SRCDIR([src/main.c]) AM_CONFIG_HEADER([config.h]) AM_INIT_AUTOMAKE AM_MAINTAINER_MODE # Checks for programs. AC_PROG_CXX AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET AC_PROG_LIBTOOL AC_CHECK_PROG(WINDRES, windres, windres) AM_CONDITIONAL(HAVE_WINDRES, test x"$WINDRES" != x) # Checks for libraries. AM_PATH_GLIB_2_0(2.22.0,, AC_MSG_ERROR(Test for GLib failed. See the 'INSTALL' for help.), gobject gio) AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal) AM_PATH_GTK_3_0(3.0.0,, AC_MSG_ERROR(Test for Gtk failed. See the 'INSTALL' for help.)) # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([fcntl.h locale.h stdlib.h string.h unistd.h]) # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STAT AC_C_CONST AC_TYPE_SIZE_T AC_STRUCT_TM GETTEXT_PACKAGE="$PACKAGE" AC_SUBST(GETTEXT_PACKAGE) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Define the gettext package to be used]) ALL_LINGUAS="ja" AM_GLIB_GNU_GETTEXT dnl Set PACKAGE_LOCALE_DIR in config.h. if test "x${prefix}" = "xNONE"; then AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${ac_default_prefix}/${DATADIRNAME}/locale", [Define the location where the catalogs will be installed]) else AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${prefix}/${DATADIRNAME}/locale") fi # Checks for library functions. AC_FUNC_STRFTIME AC_CHECK_FUNCS([isascii memset mkdir setlocale strchr strpbrk strrchr strstr strtol]) AC_CHECK_FUNCS(bind_textdomain_codeset) AC_CHECK_FUNCS(localtime_r) AC_CONFIG_FILES([ Makefile libloqui/Makefile libloqui/protocols/Makefile libloqui/protocols/jabber/Makefile src/Makefile src/icons/Makefile src/embedtxt/Makefile po/Makefile.in m4/Makefile loqui.spec ]) AC_OUTPUT loqui-0.7.0/libloqui/000077500000000000000000000000001401145342000144615ustar00rootroot00000000000000loqui-0.7.0/libloqui/Makefile.am.m4000066400000000000000000000101731401145342000170360ustar00rootroot00000000000000include(loqui-am-macros.m4)dnl SUBDIRS = . protocols INCLUDES = $(GLIB_CFLAGS) $(GNET_CFLAGS) $(EXTRA_WARNING_CFLAGS) -I$(includedir) -I$(top_srcdir) -DG_LOG_DOMAIN=\"libloqui\" AM_CFLAGS = -g -Wall -Wredundant-decls -Wmissing-declarations -Wmissing-prototypes %.c %.h %-private.h: %.gob gob2 --always-private-header $< SRC_BASE_UTILITIES = \ loqui-utils.c loqui-utils.h \ loqui_webutils.c loqui_webutils.h \ loqui-gobject-utils.c loqui-gobject-utils.h \ loqui_string_tokenizer.c loqui_string_tokenizer.h \ loqui_title_format.c loqui_title_format.h \ loqui_marshalers.c loqui_marshalers.h define(`M4_SRC_PROTOCOL_BASE_BASE_GOB',`loqui-generic-profile-factory.gob loqui-property-profile.gob loqui-message-text.gob loqui-message-text-region.gob') SRC_PROTOCOL_BASE_BASE = \ loqui_channel_entry.c loqui_channel_entry.h \ loqui_codeconv_tools.c loqui_codeconv_tools.h \ loqui_codeconv.c loqui_codeconv.h \ loqui_channel_buffer.c loqui_channel_buffer.h \ loqui_channel_entry_utils.c loqui_channel_entry_utils.h \ loqui-profile.c loqui-profile.h \ loqui-profile-factory.c loqui-profile-factory.h \ M4_SRC_PROTOCOL_BASE_BASE_GOB gob_to_built_sources(M4_SRC_PROTOCOL_BASE_BASE_GOB) define(`M4_SRC_PROTOCOL_BASE_GOB',`loqui-protocol.gob loqui-mode-item.gob loqui-mode-manager.gob loqui-transfer-item.gob') SRC_PROTOCOL_BASE = \ loqui_user.c loqui_user.h \ loqui_profile_account.c loqui_profile_account.h \ loqui_channel.c loqui_channel.h \ loqui_sender.c loqui_sender.h \ loqui_receiver.c loqui_receiver.h \ loqui_account.c loqui_account.h \ loqui_message.c loqui_message.h \ loqui_member.c loqui_member.h \ M4_SRC_PROTOCOL_BASE_GOB gob_to_built_sources(M4_SRC_PROTOCOL_BASE_GOB) dnl define(`M4_SRC_PROTOCOL_IRC_GOB',`') SRC_PROTOCOL_IRC = \ loqui_protocol_irc.c loqui_protocol_irc.h \ loqui_user_irc.c loqui_user_irc.h \ loqui_utils_irc.c loqui_utils_irc.h \ loqui_channel_irc.c loqui_channel_irc.h \ loqui_profile_account_irc.c loqui_profile_account_irc.h \ loqui_sender_irc.c loqui_sender_irc.h \ loqui_receiver_irc.c loqui_receiver_irc.h \ loqui_account_irc.c loqui_account_irc.h \ irc_constants.h \ irc_message.c irc_message.h \ ctcp_message.c ctcp_message.h \ ctcp_handle.c ctcp_handle.h dnl M4_SRC_PROTOCOL_IRC_GOB gob_to_built_sources(M4_SRC_PROTOCOL_IRC_GOB) define(`M4_SRC_PROTOCOL_IPMSG_GOB',`loqui-account-ipmsg.gob loqui-receiver-ipmsg.gob loqui-sender-ipmsg.gob loqui-socket-ipmsg.gob') SRC_PROTOCOL_IPMSG = \ loqui_protocol_ipmsg.c loqui_protocol_ipmsg.h \ loqui_user_ipmsg.c loqui_user_ipmsg.h \ loqui-utils-ipmsg.c loqui-utils-ipmsg.h \ loqui_profile_account_ipmsg.c loqui_profile_account_ipmsg.h \ ipmsg.h \ ipmsg_packet.c ipmsg_packet.h \ M4_SRC_PROTOCOL_IPMSG_GOB gob_to_built_sources(M4_SRC_PROTOCOL_IPMSG_GOB) define(`M4_SRC_LIBRARY_CORE_GOB',`loqui-core.gob loqui-pref.gob loqui-pref-partial.gob loqui-pref-sequence.gob loqui-profile-handle.gob loqui-account-manager.gob loqui-notifier.gob')dnl SRC_LIBRARY_CORE = \ libloqui-intl.h \ loqui_protocol_manager.c loqui_protocol_manager.h \ loqui_member_sort_funcs.c loqui_member_sort_funcs.h \ loqui-general-pref-groups.h loqui-general-pref-default.h \ loqui_account_manager_iter.c loqui_account_manager_iter.h \ loqui-static-core.c loqui-static-core.h \ loqui.h \ M4_SRC_LIBRARY_CORE_GOB \ gob_to_built_sources(M4_SRC_LIBRARY_CORE_GOB) BUILT_SOURCES := loqui_marshalers.c loqui_marshalers.h \ gob_to_built_sources(M4_SRC_LIBRARY_CORE_GOB) \ gob_to_built_sources(M4_SRC_PROTOCOL_BASE_BASE_GOB) \ gob_to_built_sources(M4_SRC_PROTOCOL_BASE_GOB) \ gob_to_built_sources(M4_SRC_PROTOCOL_IPMSG_GOB) dnl gob_to_built_sources(M4_SRC_PROTOCOL_IRC_GOB) noinst_LTLIBRARIES = libloqui.la libloqui_la_SOURCES = \ $(SRC_BASE_UTILITIES) \ $(SRC_PROTOCOL_BASE_BASE) \ $(SRC_PROTOCOL_BASE) \ $(SRC_PROTOCOL_IRC) \ $(SRC_PROTOCOL_IPMSG) \ $(SRC_LIBRARY_CORE) libloqui_la_LIBADD = \ $(GLIB_LIBS) \ $(GNET_LIBS) loqui_marshalers.h : loqui_marshalers.list $(GLIB_GENMARSHAL) $(GLIB_GENMARSHAL) $< --header --prefix=_loqui_marshal > $@ loqui_marshalers.c : loqui_marshalers.list $(GLIB_GENMARSHAL) $(GLIB_GENMARSHAL) $< --body --prefix=_loqui_marshal > $@ EXTRA_DIST = \ loqui_marshalers.list loqui-0.7.0/libloqui/ctcp_handle.c000066400000000000000000000314661401145342000171030ustar00rootroot00000000000000/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * libloqui -- Chat/IM client library for GLib * Copyright (C) 2002-2004 Yoichi Imai * * This Library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This Library 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with the Gnome Library; see the file COPYING.LIB. If not, * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #include "config.h" #include "ctcp_handle.h" #include "ctcp_message.h" #include #include "loqui_profile_account_irc.h" #include "loqui_sender_irc.h" #include "loqui_account_irc.h" #include "loqui_channel.h" #include #include #include #include struct _CTCPHandlePrivate { LoquiAccount *account; LoquiReceiverIRC *receiver; GTimer *interval_timer; }; typedef struct _CTCPHandlerElement { gchar *command; void (* func) (CTCPHandle *ctcp_handle, CTCPMessage *ctcp_msg, const gchar *sender); } CTCPHandlerElement; static GObjectClass *parent_class = NULL; #define PARENT_TYPE G_TYPE_OBJECT #define CTCP_INTERVAL 0.5 static void ctcp_handle_class_init(CTCPHandleClass *klass); static void ctcp_handle_init(CTCPHandle *ctcp_handle); static void ctcp_handle_finalize(GObject *object); static void ctcp_handle_version(CTCPHandle *ctcp_handle, CTCPMessage *ctcp_msg, const gchar *sender); static void ctcp_handle_ping(CTCPHandle *ctcp_handle, CTCPMessage *ctcp_msg, const gchar *sender); static void ctcp_handle_userinfo(CTCPHandle *ctcp_handle, CTCPMessage *ctcp_msg, const gchar *sender); static void ctcp_handle_clientinfo(CTCPHandle *ctcp_handle, CTCPMessage *ctcp_msg, const gchar *sender); static void ctcp_handle_dcc(CTCPHandle *ctcp_handle, CTCPMessage *ctcp_msg, const gchar *sender); static void ctcp_handle_dcc_send(CTCPHandle *ctcp_handle, CTCPMessage *ctcp_msg, const gchar *sender); #define SUPPORTED_CTCP_REQUEST "CLIENTINFO VERSION PING USERINFO" static CTCPHandlerElement handler_table[] = { {IRCCTCPVersion, ctcp_handle_version}, {IRCCTCPPing, ctcp_handle_ping}, {IRCCTCPClientInfo, ctcp_handle_clientinfo}, {IRCCTCPUserInfo, ctcp_handle_userinfo}, {IRCCTCPTime, NULL}, {IRCCTCPFinger, NULL}, {IRCCTCPDCC, ctcp_handle_dcc}, {NULL, 0} }; GType ctcp_handle_get_type(void) { static GType type = 0; if (type == 0) { static const GTypeInfo our_info = { sizeof(CTCPHandleClass), NULL, /* base_init */ NULL, /* base_finalize */ (GClassInitFunc) ctcp_handle_class_init, NULL, /* class_finalize */ NULL, /* class_data */ sizeof(CTCPHandle), 0, /* n_preallocs */ (GInstanceInitFunc) ctcp_handle_init }; type = g_type_register_static(PARENT_TYPE, "CTCPHandle", &our_info, 0); } return type; } static void ctcp_handle_class_init(CTCPHandleClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS(klass); parent_class = g_type_class_peek_parent(klass); object_class->finalize = ctcp_handle_finalize; } static void ctcp_handle_init(CTCPHandle *ctcp_handle) { CTCPHandlePrivate *priv; priv = g_new0(CTCPHandlePrivate, 1); priv->interval_timer = g_timer_new(); g_timer_start(priv->interval_timer); ctcp_handle->priv = priv; } static void ctcp_handle_finalize(GObject *object) { CTCPHandle *ctcp_handle; g_return_if_fail(object != NULL); g_return_if_fail(IS_CTCP_HANDLE(object)); ctcp_handle = CTCP_HANDLE(object); if (G_OBJECT_CLASS(parent_class)->finalize) (* G_OBJECT_CLASS(parent_class)->finalize) (object); g_free(ctcp_handle->priv); } CTCPHandle* ctcp_handle_new(LoquiReceiverIRC *receiver, LoquiAccount *account) { CTCPHandle *ctcp_handle; CTCPHandlePrivate *priv; ctcp_handle = g_object_new(ctcp_handle_get_type(), NULL); priv = ctcp_handle->priv; priv->account = account; priv->receiver = receiver; return ctcp_handle; } void ctcp_handle_message(CTCPHandle *ctcp_handle, CTCPMessage *ctcp_msg, gboolean is_request) { gint i; CTCPHandlePrivate *priv; gchar *buf, *sender, *receiver; LoquiAccount *account; LoquiChannel *channel; g_return_if_fail(ctcp_handle != NULL); g_return_if_fail(IS_CTCP_HANDLE(ctcp_handle)); g_return_if_fail(ctcp_msg != NULL); g_return_if_fail(IS_CTCP_MESSAGE(ctcp_msg)); priv = ctcp_handle->priv; account = priv->account; if(ctcp_msg->command == NULL) return; sender = g_object_get_data(G_OBJECT(ctcp_msg), "sender"); if(sender == NULL) { g_warning(_("Sender is not set in a CTCP message")); return; } receiver = g_object_get_data(G_OBJECT(ctcp_msg), "receiver"); if(receiver == NULL) { g_warning(_("Receiver is not set in a CTCP message")); return; } if (strcmp(ctcp_msg->command, IRCCTCPAction) == 0) { channel = loqui_account_get_channel_by_identifier(account, receiver); if (channel) { loqui_channel_append_remark(channel, LOQUI_TEXT_TYPE_ACTION, loqui_account_irc_is_current_nick(LOQUI_ACCOUNT_IRC(account), sender), sender, ctcp_msg->argument ? ctcp_msg->argument : ""); return; } } buf = g_strdup_printf(_("Received CTCP %1$s from %2$s to %3$s: %4$s%5$s%6$s"), is_request ? "request" : "reply", sender, receiver, ctcp_msg->command, ctcp_msg->argument ? " " : "", ctcp_msg->argument ? ctcp_msg->argument : ""); loqui_account_append_text(priv->account, NULL, LOQUI_TEXT_TYPE_INFO, buf); g_free(buf); if(!is_request) return; g_timer_stop(priv->interval_timer); if(g_timer_elapsed(priv->interval_timer, NULL) < CTCP_INTERVAL) { loqui_account_append_text(priv->account, NULL, LOQUI_TEXT_TYPE_INFO, _("The CTCP request was ignored.")); g_timer_start(priv->interval_timer); return; } for(i = 0; handler_table[i].command != NULL; i++) { if(strcmp(ctcp_msg->command, handler_table[i].command) == 0 && handler_table[i].func != NULL) { handler_table[i].func(ctcp_handle, ctcp_msg, sender); } } g_timer_reset(priv->interval_timer); g_timer_start(priv->interval_timer); } static void ctcp_handle_send_ctcp_reply(CTCPHandle *ctcp_handle, CTCPMessage *ctcp_msg, const gchar *target) { CTCPHandlePrivate *priv; gchar *buf; LoquiSender *sender; g_return_if_fail(ctcp_handle != NULL); g_return_if_fail(IS_CTCP_HANDLE(ctcp_handle)); priv = ctcp_handle->priv; buf = ctcp_message_to_str(ctcp_msg); sender = loqui_account_get_sender(priv->account); loqui_sender_irc_notice_raw(LOQUI_SENDER_IRC(sender), target, buf); g_free(buf); } static void ctcp_handle_version(CTCPHandle *ctcp_handle, CTCPMessage *ctcp_msg, const gchar *sender) { CTCPHandlePrivate *priv; CTCPMessage *ctcp_reply; gchar *buf; g_return_if_fail(ctcp_handle != NULL); g_return_if_fail(IS_CTCP_HANDLE(ctcp_handle)); priv = ctcp_handle->priv; buf = loqui_core_get_version_info(loqui_get_core()); ctcp_reply = ctcp_message_new(IRCCTCPVersion, buf); g_free(buf); ctcp_handle_send_ctcp_reply(ctcp_handle, ctcp_reply, sender); g_object_unref(ctcp_reply); } static void ctcp_handle_ping(CTCPHandle *ctcp_handle, CTCPMessage *ctcp_msg, const gchar *sender) { CTCPHandlePrivate *priv; CTCPMessage *ctcp_reply; g_return_if_fail(ctcp_handle != NULL); g_return_if_fail(IS_CTCP_HANDLE(ctcp_handle)); priv = ctcp_handle->priv; ctcp_reply = ctcp_message_new(IRCCTCPPing, NULL); ctcp_handle_send_ctcp_reply(ctcp_handle, ctcp_reply, sender); g_object_unref(ctcp_reply); } static void ctcp_handle_userinfo(CTCPHandle *ctcp_handle, CTCPMessage *ctcp_msg, const gchar *sender) { CTCPHandlePrivate *priv; CTCPMessage *ctcp_reply; g_return_if_fail(ctcp_handle != NULL); g_return_if_fail(IS_CTCP_HANDLE(ctcp_handle)); priv = ctcp_handle->priv; /* FIXME: should quote string with ctcp */ ctcp_reply = ctcp_message_new(IRCCTCPUserInfo, loqui_profile_account_irc_get_userinfo(LOQUI_PROFILE_ACCOUNT_IRC(loqui_account_get_profile(priv->account)))); ctcp_handle_send_ctcp_reply(ctcp_handle, ctcp_reply, sender); g_object_unref(ctcp_reply); } static void ctcp_handle_clientinfo(CTCPHandle *ctcp_handle, CTCPMessage *ctcp_msg, const gchar *sender) { CTCPHandlePrivate *priv; CTCPMessage *ctcp_reply; g_return_if_fail(ctcp_handle != NULL); g_return_if_fail(IS_CTCP_HANDLE(ctcp_handle)); priv = ctcp_handle->priv; ctcp_reply = ctcp_message_new(IRCCTCPClientInfo, SUPPORTED_CTCP_REQUEST); ctcp_handle_send_ctcp_reply(ctcp_handle, ctcp_reply, sender); g_object_unref(ctcp_reply); } static void ctcp_handle_dcc(CTCPHandle *ctcp_handle, CTCPMessage *ctcp_msg, const gchar *sender) { CTCPHandlePrivate *priv; const gchar *subcommand; gchar *str; g_return_if_fail(ctcp_handle != NULL); g_return_if_fail(IS_CTCP_HANDLE(ctcp_handle)); priv = ctcp_handle->priv; subcommand = ctcp_message_get_param(ctcp_msg, 0); if (subcommand == NULL) { loqui_account_warning(priv->account, _("This DCC request doesn't have subcommand: %s"), subcommand); return; } if (strcmp(subcommand, IRCDCCSend) == 0) { ctcp_handle_dcc_send(ctcp_handle, ctcp_msg, sender); return; } str = ctcp_message_to_str(ctcp_msg); loqui_account_warning(priv->account, _("This DCC request has an unsupported subcommand: %s (%s)"), subcommand, str); g_free(str); } static void ctcp_handle_dcc_send(CTCPHandle *ctcp_handle, CTCPMessage *ctcp_msg, const gchar *sender) { CTCPHandlePrivate *priv; /* LoquiTransferItem *trans_item; */ const gchar *filename, *address, *port_str, *size_str; gchar *str; gchar *canon_addr; gint port, size; GInetAddress *addr; guint64 d; guint32 network_order; gchar *endptr; priv = ctcp_handle->priv; if (ctcp_message_count_parameters(ctcp_msg) != 5) { str = ctcp_message_to_str(ctcp_msg); loqui_account_warning(priv->account, _("Invalid DCC request (invalid parameter length: %d (%s))"), ctcp_message_count_parameters(ctcp_msg), str); g_free(str); return; } filename = ctcp_message_get_param(ctcp_msg, 1); address = ctcp_message_get_param(ctcp_msg, 2); port_str = ctcp_message_get_param(ctcp_msg, 3); size_str = ctcp_message_get_param(ctcp_msg, 4); d = g_ascii_strtoull(port_str, &endptr, 10); if (d == 0 || d > G_MAXINT || endptr != (port_str + strlen(port_str))) { loqui_account_warning(priv->account, "The port in the DCC request is invalid to be a number: %s\n", port_str); return; } port = (gint32) d; d = g_ascii_strtoull(size_str, &endptr, 10); if (d == 0 || d > G_MAXUINT || endptr != (size_str + strlen(size_str))) { loqui_account_warning(priv->account, "The size in the DCC request is invalid to be a number: %s\n", size_str); return; } size = (gint32) d; /* FIXME: IPv6 is not supported */ d = g_ascii_strtoull(address, &endptr, 10); if (d == 0 || d > G_MAXUINT || endptr != (address + strlen(address))) { loqui_account_warning(priv->account, "The address in the DCC request is invalid to be a number: %s\n", address); return; } network_order = g_htonl((guint32) d); addr = g_inet_address_new_from_bytes((guint8 *) &network_order, G_SOCKET_FAMILY_IPV4); if (addr == NULL) { loqui_account_warning(priv->account, "Address in the DCC request is invalid: %s\n", address); return; } canon_addr = g_inet_address_to_string(addr); loqui_account_information(priv->account, _("Received DCC SEND request from %s (filename: %s, host: %s, port: %s, size: %s)"), sender, filename, canon_addr, port_str, size_str); /* FIXME: create transfer item and register it to the manager */ /* trans_item = LOQUI_TRANSFER_ITEM(loqui_transfer_item_irc_new()); loqui_transfer_item_set_is_upload(trans_item, FALSE); loqui_transfer_item_set_filename(trans_item, filename); loqui_transfer_item_set_address(trans_item, canon_addr); loqui_transfer_item_set_port(trans_item, port); loqui_transfer_item_set_size(trans_item, size); loqui_transfer_item_irc_set_inet_addr(LOQUI_TRANSFER_ITEM_IRC(trans_item), addr); */ /* FIXME: quick hack to receive DCC SEND */ { const gchar *command; gchar *buf; command = g_getenv("LOQUI_DCC_COMMAND"); if (command) { buf = g_strdup_printf("%s %s %s %d %d %s %s", command, filename, address, port, size, canon_addr, sender); if (!g_spawn_command_line_async(buf, NULL)) g_warning("Failed to execute DCC command"); g_free(buf); } } g_free(canon_addr); g_object_unref(addr); /* g_object_unref(trans_item); */ } loqui-0.7.0/libloqui/ctcp_handle.h000066400000000000000000000044301401145342000170770ustar00rootroot00000000000000/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * libloqui -- Chat/IM client library for GLib * Copyright (C) 2002-2004 Yoichi Imai * * This Library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This Library 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with the Gnome Library; see the file COPYING.LIB. If not, * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #ifndef __CTCP_HANDLE_H__ #define __CTCP_HANDLE_H__ #include #include "loqui_account.h" #include "loqui_receiver_irc.h" #include "ctcp_message.h" G_BEGIN_DECLS #define TYPE_CTCP_HANDLE (ctcp_handle_get_type ()) #define CTCP_HANDLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CTCP_HANDLE, CTCPHandle)) #define CTCP_HANDLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CTCP_HANDLE, CTCPHandleClass)) #define IS_CTCP_HANDLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CTCP_HANDLE)) #define IS_CTCP_HANDLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CTCP_HANDLE)) #define CTCP_HANDLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CTCP_HANDLE, CTCPHandleClass)) typedef struct _CTCPHandle CTCPHandle; typedef struct _CTCPHandleClass CTCPHandleClass; typedef struct _CTCPHandlePrivate CTCPHandlePrivate; struct _CTCPHandle { GObject parent; CTCPHandlePrivate *priv; }; struct _CTCPHandleClass { GObjectClass parent_class; }; GType ctcp_handle_get_type (void) G_GNUC_CONST; CTCPHandle* ctcp_handle_new(LoquiReceiverIRC *receiver, LoquiAccount *account); void ctcp_handle_message(CTCPHandle *ctcp_handle, CTCPMessage *ctcp_msg, gboolean is_request); G_END_DECLS #endif /* __CTCP_HANDLE_H__ */ loqui-0.7.0/libloqui/ctcp_message.c000066400000000000000000000113071401145342000172640ustar00rootroot00000000000000/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * libloqui -- Chat/IM client library for GLib * Copyright (C) 2002-2004 Yoichi Imai * * This Library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This Library 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with the Gnome Library; see the file COPYING.LIB. If not, * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #include "config.h" #include "ctcp_message.h" #include "irc_constants.h" #include "loqui-utils.h" #include #include struct _CTCPMessagePrivate { }; static GObjectClass *parent_class = NULL; #define PARENT_TYPE G_TYPE_OBJECT static void ctcp_message_class_init(CTCPMessageClass *klass); static void ctcp_message_init(CTCPMessage *ctcp_message); static void ctcp_message_finalize(GObject *object); GType ctcp_message_get_type(void) { static GType type = 0; if (type == 0) { static const GTypeInfo our_info = { sizeof(CTCPMessageClass), NULL, /* base_init */ NULL, /* base_finalize */ (GClassInitFunc) ctcp_message_class_init, NULL, /* class_finalize */ NULL, /* class_data */ sizeof(CTCPMessage), 0, /* n_preallocs */ (GInstanceInitFunc) ctcp_message_init }; type = g_type_register_static(PARENT_TYPE, "CTCPMessage", &our_info, 0); } return type; } static void ctcp_message_class_init(CTCPMessageClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS(klass); parent_class = g_type_class_peek_parent(klass); object_class->finalize = ctcp_message_finalize; } static void ctcp_message_init(CTCPMessage *ctcp_message) { CTCPMessagePrivate *priv; priv = g_new0(CTCPMessagePrivate, 1); ctcp_message->priv = priv; } static void ctcp_message_finalize(GObject *object) { CTCPMessage *ctcp_msg; g_return_if_fail(object != NULL); g_return_if_fail(IS_CTCP_MESSAGE(object)); ctcp_msg = CTCP_MESSAGE(object); LOQUI_G_FREE_UNLESS_NULL(ctcp_msg->command); LOQUI_G_FREE_UNLESS_NULL(ctcp_msg->argument); if(ctcp_msg->parameters) { g_strfreev(ctcp_msg->parameters); ctcp_msg->parameters = NULL; } if (G_OBJECT_CLASS(parent_class)->finalize) (* G_OBJECT_CLASS(parent_class)->finalize) (object); g_free(ctcp_msg->priv); } CTCPMessage* ctcp_message_new(const gchar *command, const gchar *argument) { CTCPMessage *ctcp_msg; ctcp_msg = g_object_new(ctcp_message_get_type(), NULL); ctcp_msg->command = g_strdup(command); if(argument) { ctcp_msg->argument = g_strdup(argument); ctcp_msg->parameters = g_strsplit(argument, " ", 0); } return ctcp_msg; } gboolean ctcp_message_parse_line(const gchar *line, CTCPMessage **ctcp_msg) { gchar *cur, *start, *end, *command, *argument = NULL; gchar *buf; if(line == NULL) return FALSE; buf = g_strdup(line); start = strchr(buf, IRCCommandChar); if(start == NULL) { g_free(buf); return FALSE; } cur = start+1; if(*cur == '\0') { g_free(buf); return FALSE; } end = strchr(cur, IRCCommandChar); if(end == NULL) { g_free(buf); return FALSE; } *end = '\0'; command = cur; cur = strchr(cur, ' '); if(cur != NULL) { *cur = '\0'; cur++; if(*cur != '\0') argument = cur; } if(ctcp_msg) *ctcp_msg = ctcp_message_new(command, argument); g_free(buf); return TRUE; } gchar * ctcp_message_to_str(CTCPMessage *ctcp_msg) { gchar *str; str = g_strdup_printf("%c%s %s%c", IRCCommandChar, ctcp_msg->command, ctcp_msg->argument ? ctcp_msg->argument : "", IRCCommandChar); return str; } gint ctcp_message_count_parameters(CTCPMessage *ctcp_msg) { g_return_val_if_fail(ctcp_msg != NULL, 0); g_return_val_if_fail(IS_CTCP_MESSAGE(ctcp_msg), 0); return loqui_utils_count_strarray((const gchar **) ctcp_msg->parameters); } G_CONST_RETURN gchar * ctcp_message_get_param(CTCPMessage *ctcp_msg, gint i) { g_return_val_if_fail(ctcp_msg != NULL, NULL); g_return_val_if_fail(IS_CTCP_MESSAGE(ctcp_msg), NULL); if (ctcp_message_count_parameters(ctcp_msg) <= i) { return NULL; } return ctcp_msg->parameters[i]; } loqui-0.7.0/libloqui/ctcp_message.h000066400000000000000000000047761401145342000173050ustar00rootroot00000000000000/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * libloqui -- Chat/IM client library for GLib * Copyright (C) 2002-2004 Yoichi Imai * * This Library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This Library 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with the Gnome Library; see the file COPYING.LIB. If not, * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #ifndef __CTCP_MESSAGE_H__ #define __CTCP_MESSAGE_H__ #include G_BEGIN_DECLS #define TYPE_CTCP_MESSAGE (ctcp_message_get_type ()) #define CTCP_MESSAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CTCP_MESSAGE, CTCPMessage)) #define CTCP_MESSAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CTCP_MESSAGE, CTCPMessageClass)) #define IS_CTCP_MESSAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CTCP_MESSAGE)) #define IS_CTCP_MESSAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CTCP_MESSAGE)) #define CTCP_MESSAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CTCP_MESSAGE, CTCPMessageClass)) typedef struct _CTCPMessage CTCPMessage; typedef struct _CTCPMessageClass CTCPMessageClass; typedef struct _CTCPMessagePrivate CTCPMessagePrivate; struct _CTCPMessage { GObject parent; gchar *command; gchar *argument; gchar **parameters; /* split argument with ' '; null terminated */ CTCPMessagePrivate *priv; }; struct _CTCPMessageClass { GObjectClass parent_class; }; GType ctcp_message_get_type (void) G_GNUC_CONST; CTCPMessage* ctcp_message_new(const gchar *command, const gchar *argument); gboolean ctcp_message_parse_line(const gchar *line, CTCPMessage **ctcp_msg); gchar *ctcp_message_to_str(CTCPMessage *ctcp_msg); gint ctcp_message_count_parameters(CTCPMessage *ctcp_msg); G_CONST_RETURN gchar *ctcp_message_get_param(CTCPMessage *ctcp_msg, gint i); /* zero origin */ G_END_DECLS #endif /* __CTCP_MESSAGE_H__ */ loqui-0.7.0/libloqui/ipmsg.h000066400000000000000000000126011401145342000157510ustar00rootroot00000000000000/* The constants are based on ipmsg205src/ipmsg.h */ /* @(#)Copyright (C) H.Shirouzu 1996-2004 ipmsg.h Ver2.05 */ /* ======================================================================== Project Name : IP Messenger for Win32 Module Name : Main Header Create : 1996-06-01(Sat) Update : 2004-01-01(Thu) Copyright : H.Shirouzu Reference : ======================================================================== */ #ifndef IPMSG_H #define IPMSG_H /* START added by Loqui */ /* ver,packet num, username, hostname, command num, extra */ #define IPMSG_COMMAND_NUMBER 6 #define IPMSG_COMMAND_POSITION_VERSION 0 #define IPMSG_COMMAND_POSITION_PACKET_NUMBER 1 #define IPMSG_COMMAND_POSITION_USERNAME 2 #define IPMSG_COMMAND_POSITION_HOSTNAME 3 #define IPMSG_COMMAND_POSITION_COMMAND_NUMBER 4 #define IPMSG_COMMAND_POSITION_EXTRA 5 /* END added */ /* IP Messenger Communication Protocol version 1.2 define */ /* macro */ #define IPMSG_GET_MODE(command) (command & 0x000000ffUL) #define IPMSG_GET_OPT(command) (command & 0xffffff00UL) /* header */ #define IPMSG_VERSION 0x0001 #define IPMSG_DEFAULT_PORT 0x0979 /* command */ #define IPMSG_NOOPERATION 0x00000000UL #define IPMSG_BR_ENTRY 0x00000001UL #define IPMSG_BR_EXIT 0x00000002UL #define IPMSG_ANSENTRY 0x00000003UL #define IPMSG_BR_ABSENCE 0x00000004UL #define IPMSG_BR_ISGETLIST 0x00000010UL #define IPMSG_OKGETLIST 0x00000011UL #define IPMSG_GETLIST 0x00000012UL #define IPMSG_ANSLIST 0x00000013UL #define IPMSG_BR_ISGETLIST2 0x00000018UL #define IPMSG_SENDMSG 0x00000020UL #define IPMSG_RECVMSG 0x00000021UL #define IPMSG_READMSG 0x00000030UL #define IPMSG_DELMSG 0x00000031UL #define IPMSG_ANSREADMSG 0x00000032UL #define IPMSG_GETINFO 0x00000040UL #define IPMSG_SENDINFO 0x00000041UL #define IPMSG_GETABSENCEINFO 0x00000050UL #define IPMSG_SENDABSENCEINFO 0x00000051UL #define IPMSG_GETFILEDATA 0x00000060UL #define IPMSG_RELEASEFILES 0x00000061UL #define IPMSG_GETDIRFILES 0x00000062UL #define IPMSG_GETPUBKEY 0x00000072UL #define IPMSG_ANSPUBKEY 0x00000073UL /* option for all command */ #define IPMSG_ABSENCEOPT 0x00000100UL #define IPMSG_SERVEROPT 0x00000200UL #define IPMSG_DIALUPOPT 0x00010000UL #define IPMSG_FILEATTACHOPT 0x00200000UL #define IPMSG_ENCRYPTOPT 0x00400000UL /* option for send command */ #define IPMSG_SENDCHECKOPT 0x00000100UL #define IPMSG_SECRETOPT 0x00000200UL #define IPMSG_BROADCASTOPT 0x00000400UL #define IPMSG_MULTICASTOPT 0x00000800UL #define IPMSG_NOPOPUPOPT 0x00001000UL #define IPMSG_AUTORETOPT 0x00002000UL #define IPMSG_RETRYOPT 0x00004000UL #define IPMSG_PASSWORDOPT 0x00008000UL #define IPMSG_NOLOGOPT 0x00020000UL #define IPMSG_NEWMUTIOPT 0x00040000UL #define IPMSG_NOADDLISTOPT 0x00080000UL #define IPMSG_READCHECKOPT 0x00100000UL #define IPMSG_SECRETEXOPT (IPMSG_READCHECKOPT|IPMSG_SECRETOPT) /* encryption flags for encrypt command */ #define IPMSG_RSA_512 0x00000001UL #define IPMSG_RSA_1024 0x00000002UL #define IPMSG_RSA_2048 0x00000004UL #define IPMSG_RC2_40 0x00001000UL #define IPMSG_RC2_128 0x00004000UL #define IPMSG_RC2_256 0x00008000UL #define IPMSG_BLOWFISH_128 0x00020000UL #define IPMSG_BLOWFISH_256 0x00040000UL #define IPMSG_SIGN_MD5 0x10000000UL /* compatibilty for Win beta version */ #define IPMSG_RC2_40OLD 0x00000010UL // for beta1-4 only #define IPMSG_RC2_128OLD 0x00000040UL // for beta1-4 only #define IPMSG_BLOWFISH_128OLD 0x00000400UL // for beta1-4 only #define IPMSG_RC2_40ALL (IPMSG_RC2_40|IPMSG_RC2_40OLD) #define IPMSG_RC2_128ALL (IPMSG_RC2_128|IPMSG_RC2_128OLD) #define IPMSG_BLOWFISH_128ALL (IPMSG_BLOWFISH_128|IPMSG_BLOWFISH_128OLD) /* file types for fileattach command */ #define IPMSG_FILE_REGULAR 0x00000001UL #define IPMSG_FILE_DIR 0x00000002UL #define IPMSG_FILE_RETPARENT 0x00000003UL // return parent directory #define IPMSG_FILE_SYMLINK 0x00000004UL #define IPMSG_FILE_CDEV 0x00000005UL // for UNIX #define IPMSG_FILE_BDEV 0x00000006UL // for UNIX #define IPMSG_FILE_FIFO 0x00000007UL // for UNIX #define IPMSG_FILE_RESFORK 0x00000010UL // for Mac /* file attribute options for fileattach command */ #define IPMSG_FILE_RONLYOPT 0x00000100UL #define IPMSG_FILE_HIDDENOPT 0x00001000UL #define IPMSG_FILE_EXHIDDENOPT 0x00002000UL // for MacOS X #define IPMSG_FILE_ARCHIVEOPT 0x00004000UL #define IPMSG_FILE_SYSTEMOPT 0x00008000UL /* extend attribute types for fileattach command */ #define IPMSG_FILE_UID 0x00000001UL #define IPMSG_FILE_USERNAME 0x00000002UL // uid by string #define IPMSG_FILE_GID 0x00000003UL #define IPMSG_FILE_GROUPNAME 0x00000004UL // gid by string #define IPMSG_FILE_PERM 0x00000010UL // for UNIX #define IPMSG_FILE_MAJORNO 0x00000011UL // for UNIX devfile #define IPMSG_FILE_MINORNO 0x00000012UL // for UNIX devfile #define IPMSG_FILE_CTIME 0x00000013UL // for UNIX #define IPMSG_FILE_MTIME 0x00000014UL #define IPMSG_FILE_ATIME 0x00000015UL #define IPMSG_FILE_CREATETIME 0x00000016UL #define IPMSG_FILE_CREATOR 0x00000020UL // for Mac #define IPMSG_FILE_FILETYPE 0x00000021UL // for Mac #define IPMSG_FILE_FINDERINFO 0x00000022UL // for Mac #define IPMSG_FILE_ACL 0x00000030UL #define IPMSG_FILE_ALIASFNAME 0x00000040UL // alias fname #define IPMSG_FILE_UNICODEFNAME 0x00000041UL // UNICODE fname #define FILELIST_SEPARATOR '\a' #define HOSTLIST_SEPARATOR '\a' #define HOSTLIST_DUMMY "\b" /* end of IP Messenger Communication Protocol version 1.2 define */ #endif loqui-0.7.0/libloqui/ipmsg_packet.c000066400000000000000000000234551401145342000173040ustar00rootroot00000000000000/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * libloqui -- Chat/IM client library for GLib * Copyright (C) 2004 Yoichi Imai * * This Library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This Library 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with the Gnome Library; see the file COPYING.LIB. If not, * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #include "config.h" #include "ipmsg_packet.h" #include "ipmsg.h" #include "loqui-gobject-utils.h" #include "loqui-utils.h" #include "loqui-utils-ipmsg.h" #include enum { LAST_SIGNAL }; enum { LAST_PROP }; struct _IPMsgPacketPrivate { }; static GObjectClass *parent_class = NULL; /* static guint ipmsg_packet_signals[LAST_SIGNAL] = { 0 }; */ static void ipmsg_packet_class_init(IPMsgPacketClass *klass); static void ipmsg_packet_init(IPMsgPacket *packet); static void ipmsg_packet_finalize(GObject *object); static void ipmsg_packet_dispose(GObject *object); static void ipmsg_packet_get_property(GObject *object, guint param_id, GValue *value, GParamSpec *pspec); static void ipmsg_packet_set_property(GObject *object, guint param_id, const GValue *value, GParamSpec *pspec); GType ipmsg_packet_get_type(void) { static GType type = 0; if (type == 0) { static const GTypeInfo our_info = { sizeof(IPMsgPacketClass), NULL, /* base_init */ NULL, /* base_finalize */ (GClassInitFunc) ipmsg_packet_class_init, NULL, /* class_finalize */ NULL, /* class_data */ sizeof(IPMsgPacket), 0, /* n_preallocs */ (GInstanceInitFunc) ipmsg_packet_init }; type = g_type_register_static(G_TYPE_OBJECT, "IPMsgPacket", &our_info, 0); } return type; } static void ipmsg_packet_finalize(GObject *object) { IPMsgPacket *packet; g_return_if_fail(object != NULL); g_return_if_fail(IS_IPMSG_PACKET(object)); packet = IPMSG_PACKET(object); if (G_OBJECT_CLASS(parent_class)->finalize) (* G_OBJECT_CLASS(parent_class)->finalize)(object); g_free(packet->priv); } static void ipmsg_packet_dispose(GObject *object) { IPMsgPacket *packet; g_return_if_fail(object != NULL); g_return_if_fail(IS_IPMSG_PACKET(object)); packet = IPMSG_PACKET(object); LOQUI_G_FREE_UNLESS_NULL(packet->username); LOQUI_G_FREE_UNLESS_NULL(packet->hostname); LOQUI_G_FREE_UNLESS_NULL(packet->extra); LOQUI_G_FREE_UNLESS_NULL(packet->group_name); if (packet->inetaddr) { g_object_unref(packet->inetaddr); packet->inetaddr = NULL; } if (G_OBJECT_CLASS(parent_class)->dispose) (* G_OBJECT_CLASS(parent_class)->dispose)(object); } static void ipmsg_packet_get_property(GObject *object, guint param_id, GValue *value, GParamSpec *pspec) { IPMsgPacket *packet; packet = IPMSG_PACKET(object); switch (param_id) { default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, param_id, pspec); break; } } static void ipmsg_packet_set_property(GObject *object, guint param_id, const GValue *value, GParamSpec *pspec) { IPMsgPacket *packet; packet = IPMSG_PACKET(object); switch (param_id) { default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, param_id, pspec); break; } } static void ipmsg_packet_class_init(IPMsgPacketClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS(klass); parent_class = g_type_class_peek_parent(klass); object_class->finalize = ipmsg_packet_finalize; object_class->dispose = ipmsg_packet_dispose; object_class->get_property = ipmsg_packet_get_property; object_class->set_property = ipmsg_packet_set_property; } static void ipmsg_packet_init(IPMsgPacket *packet) { IPMsgPacketPrivate *priv; priv = g_new0(IPMsgPacketPrivate, 1); packet->priv = priv; packet->version = 0; packet->packet_num = 0; packet->username = NULL; packet->hostname = NULL; packet->command_num = 0; packet->extra = NULL; packet->group_name = NULL; } IPMsgPacket* ipmsg_packet_new(void) { IPMsgPacket *packet; IPMsgPacketPrivate *priv; packet = g_object_new(ipmsg_packet_get_type(), NULL); priv = packet->priv; return packet; } IPMsgPacket * ipmsg_packet_parse(const gchar *str, gint len) { gchar *buf; gchar *cur; gchar *array[IPMSG_COMMAND_NUMBER]; gchar *group_name = NULL; guint real_len; int i, pos; IPMsgPacket *packet; if (len < 0) real_len = strlen(str); else if (len == 0) real_len = 0; else real_len = len; for (i = 0; i < IPMSG_COMMAND_NUMBER; i++) array[i] = NULL; buf = g_malloc(real_len + 1); g_memmove(buf, str, real_len); buf[real_len] = '\0'; pos = 0; array[0] = buf; cur = buf; while (cur < buf + real_len && pos < IPMSG_COMMAND_NUMBER - 1) { if (*cur == '\0') break; if (*cur == ':') { *cur = '\0'; array[++pos] = ++cur; continue; } cur++; } if (pos < IPMSG_COMMAND_NUMBER - 1) { g_free(buf); return NULL; } /* group extension */ while (cur < buf + real_len) { if (*cur == '\0') { group_name = cur+1; break; } cur++; } packet = ipmsg_packet_create((gint) g_ascii_strtoull(array[IPMSG_COMMAND_POSITION_VERSION], NULL, 10), (gint) g_ascii_strtoull(array[IPMSG_COMMAND_POSITION_PACKET_NUMBER], NULL, 10), array[IPMSG_COMMAND_POSITION_USERNAME], array[IPMSG_COMMAND_POSITION_HOSTNAME], (gint) g_ascii_strtoull(array[IPMSG_COMMAND_POSITION_COMMAND_NUMBER], NULL, 10), array[IPMSG_COMMAND_POSITION_EXTRA], group_name); g_free(buf); return packet; } IPMsgPacket * ipmsg_packet_create(gint version, gint packet_num, const gchar *username, const gchar *hostname, gint command_num, const gchar *extra, const gchar *group_name) { IPMsgPacket *packet; packet = ipmsg_packet_new(); packet->version = version; packet->packet_num = packet_num; if (username) packet->username = g_strdup(username); if (hostname) packet->hostname = g_strdup(hostname); packet->command_num = command_num; if (extra) packet->extra = g_strdup(extra); if (group_name) packet->group_name = g_strdup(group_name); return packet; } void ipmsg_packet_to_string(IPMsgPacket *packet, gchar **body, gchar **group_name) { #define LENZERO_IF_NULL(str) (str ? str : "") *body = g_strdup_printf("%d:%d:%s:%s:%d:%s", packet->version, packet->packet_num, LENZERO_IF_NULL(packet->username), LENZERO_IF_NULL(packet->hostname), packet->command_num, LENZERO_IF_NULL(packet->extra)); #undef LENZERO_IF_NULL if (packet->group_name) { *group_name = g_strdup(packet->group_name); } } gchar * ipmsg_packet_inspect(IPMsgPacket *packet) { GString *string; string = g_string_new(NULL); if (packet->inetaddr) { gchar *addr_str = ipmsg_packet_get_ip_addr(packet); g_string_append_printf(string, "from: %s:%d, ", loqui_utils_remove_ipv6_prefix_ffff(addr_str), ipmsg_packet_get_port(packet)); g_free(addr_str); } g_string_append_printf(string, "version: %d, packet number: %d,", packet->version, packet->packet_num); g_string_append_printf(string, " username: %s, host: %s, group: %s,", packet->username, packet->hostname, packet->group_name ? packet->group_name : "(not set)"); g_string_append_printf(string, " command: 0x%x (MODE: 0x%x),", packet->command_num, (int) IPMSG_GET_MODE(packet->command_num)); g_string_append_printf(string, " extra: %s", packet->extra); return g_string_free(string, FALSE); } void ipmsg_packet_print(IPMsgPacket *packet) { gchar *str; str = ipmsg_packet_inspect(packet); g_print("%s\n", str); g_free(str); } void ipmsg_packet_set_inetaddr(IPMsgPacket *packet, GInetSocketAddress *inetaddr) { g_return_if_fail(packet != NULL); g_return_if_fail(IS_IPMSG_PACKET(packet)); if (packet->inetaddr) { g_object_unref(inetaddr); packet->inetaddr = NULL; } if (inetaddr) { g_object_ref(inetaddr); packet->inetaddr = inetaddr; } } GInetSocketAddress * ipmsg_packet_get_inetaddr(IPMsgPacket *packet) { g_return_val_if_fail(packet != NULL, NULL); g_return_val_if_fail(IS_IPMSG_PACKET(packet), NULL); return packet->inetaddr; } gchar * ipmsg_packet_get_ip_addr(IPMsgPacket *packet) { gchar *addr_str; gchar *str; g_return_val_if_fail(packet != NULL, NULL); g_return_val_if_fail(IS_IPMSG_PACKET(packet), NULL); if (packet->inetaddr == NULL) return NULL; addr_str = g_inet_address_to_string(g_inet_socket_address_get_address(packet->inetaddr)); str = g_strdup(loqui_utils_remove_ipv6_prefix_ffff(addr_str)); g_free(addr_str); return str; } gint ipmsg_packet_get_port(IPMsgPacket *packet) { g_return_val_if_fail(packet != NULL, 0); g_return_val_if_fail(IS_IPMSG_PACKET(packet), 0); if (packet->inetaddr == NULL) return 0; return g_inet_socket_address_get_port(packet->inetaddr); } gchar * ipmsg_packet_get_identifier(IPMsgPacket *packet) { gchar *str; gchar *addr_str; g_return_val_if_fail(packet != NULL, NULL); g_return_val_if_fail(IS_IPMSG_PACKET(packet), NULL); if (packet->inetaddr == NULL) return NULL; addr_str = ipmsg_packet_get_ip_addr(packet); str = loqui_utils_ipmsg_create_identifier(addr_str, ipmsg_packet_get_port(packet)); g_free(addr_str); return str; } loqui-0.7.0/libloqui/ipmsg_packet.h000066400000000000000000000057341401145342000173110ustar00rootroot00000000000000/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * libloqui -- Chat/IM client library for GLib * Copyright (C) 2004 Yoichi Imai * * This Library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This Library 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with the Gnome Library; see the file COPYING.LIB. If not, * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #ifndef __IPMSG_PACKET_H__ #define __IPMSG_PACKET_H__ #include #include G_BEGIN_DECLS #define TYPE_IPMSG_PACKET (ipmsg_packet_get_type ()) #define IPMSG_PACKET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_IPMSG_PACKET, IPMsgPacket)) #define IPMSG_PACKET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_IPMSG_PACKET, IPMsgPacketClass)) #define IS_IPMSG_PACKET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_IPMSG_PACKET)) #define IS_IPMSG_PACKET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_IPMSG_PACKET)) #define IPMSG_PACKET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_IPMSG_PACKET, IPMsgPacketClass)) typedef struct _IPMsgPacket IPMsgPacket; typedef struct _IPMsgPacketClass IPMsgPacketClass; typedef struct _IPMsgPacketPrivate IPMsgPacketPrivate; struct _IPMsgPacket { GObject parent; gint version; gint packet_num; gchar *username; gchar *hostname; gint command_num; gchar *extra; gchar *group_name; GInetSocketAddress *inetaddr; IPMsgPacketPrivate *priv; }; struct _IPMsgPacketClass { GObjectClass parent_class; }; GType ipmsg_packet_get_type(void) G_GNUC_CONST; IPMsgPacket* ipmsg_packet_new(void); IPMsgPacket* ipmsg_packet_parse(const gchar *str, gint len); void ipmsg_packet_to_string(IPMsgPacket *packet, gchar **body, gchar **group_name); gchar * ipmsg_packet_inspect(IPMsgPacket *packet); void ipmsg_packet_print(IPMsgPacket *packet); void ipmsg_packet_set_inetaddr(IPMsgPacket *packet, GInetSocketAddress *inetaddr); GInetSocketAddress *ipmsg_packet_get_inetaddr(IPMsgPacket *packet); gchar *ipmsg_packet_get_ip_addr(IPMsgPacket *packet); gint ipmsg_packet_get_port(IPMsgPacket *packet); gchar *ipmsg_packet_get_identifier(IPMsgPacket *packet); IPMsgPacket *ipmsg_packet_create(gint version, gint packet_num, const gchar *username, const gchar *hostname, gint command_num, const gchar *extra, const gchar *group_name); G_END_DECLS #endif /* __IPMSG_PACKET_H__ */ loqui-0.7.0/libloqui/irc_constants.h000066400000000000000000000220361401145342000175060ustar00rootroot00000000000000/* IRC constants -- This code is based on IRCatConstants.h of IRcat-Lite */ /* IRcat Constants 1998.7 Atsushi Tagami */ #ifndef __LOQUI_IRC_CONSTANTS__ #define __LOQUI_IRC_CONSTANTS__ #define IRCCommandChar 001 #define IRCModeChar 007 #define IRC_MESSAGE_PARAMETER_MAX 15 typedef enum { IRC_CHANNEL_MODE_CREATOR = 'O', IRC_CHANNEL_MODE_OPERATOR = 'o', IRC_CHANNEL_MODE_VOICE = 'v', IRC_CHANNEL_MODE_ANONYMOUS = 'a', IRC_CHANNEL_MODE_INVITE_ONLY = 'i', IRC_CHANNEL_MODE_MODERATED = 'm', IRC_CHANNEL_MODE_NO_MESSAGES_FROM_CLIENT = 'n', IRC_CHANNEL_MODE_QUIET = 'q', IRC_CHANNEL_MODE_SECRET = 's', IRC_CHANNEL_MODE_SERVER_REOP = 'r', IRC_CHANNEL_MODE_TOPIC_SETTABLE_BY_CHANNEL_OPERATOR_ONLY = 't', IRC_CHANNEL_MODE_CHANNEL_KEY = 'k', IRC_CHANNEL_MODE_USER_LIMIT = 'l', IRC_CHANNEL_MODE_BAN_MASK = 'b', IRC_CHANNEL_MODE_EXCEPTION_TO_OVERIDE_BAN_MASK = 'e', IRC_CHANNEL_MODE_INVITATION_MASK = 'I', IRC_CHANNEL_MODE_PRIVATE = 'p', IRC_USER_MODE_FLAGGED_AS_AWAY = 'a', IRC_USER_MODE_INVISIBLE = 'i', IRC_USER_MODE_RECEIVES_WALLOPS = 'w', IRC_USER_MODE_RESTRICTED_CONNECTION = 'r', IRC_USER_MODE_OPERATOR = 'o', IRC_USER_MODE_LOCAL_OPERATOR = 'O', IRC_USER_MODE_RECEIVES_SERVER_NOTICES = 's' } IRCModeFlag; typedef enum { IRC_UNDEFINED = 9999, IRC_ERR_NOSUCHNICK = 401, IRC_ERR_NOSUCHSERVER = 402, IRC_ERR_NOSUCHCHANNEL = 403, IRC_ERR_CANNOTSENDTOCHAN = 404, IRC_ERR_TOOMANYCHANNELS = 405, IRC_ERR_WASNOSUCHNICK = 406, IRC_ERR_TOOMANYTARGETS = 407, IRC_ERR_NOSUCHSERVICE = 408, IRC_ERR_NOORIGIN = 409, IRC_ERR_NORECIPIENT = 411, IRC_ERR_NOTEXTTOSEND = 412, IRC_ERR_NOTOPLEVEL = 413, IRC_ERR_WILDTOPLEVEL = 414, IRC_ERR_BADMASK = 415, IRC_ERR_UNKNOWNCOMMAND = 421, IRC_ERR_NOMOTD = 422, IRC_ERR_NOADMININFO = 423, IRC_ERR_FILEERROR = 424, IRC_ERR_NONICKNAMEGIVEN = 431, IRC_ERR_ERRONEUSNICKNAME = 432, IRC_ERR_NICKNAMEINUSE = 433, IRC_ERR_NICKCOLLISION = 436, IRC_ERR_UNAVAILRESOURCE = 437, IRC_ERR_USERNOTINCHANNEL = 441, IRC_ERR_NOTONCHANNEL = 442, IRC_ERR_USERONCHANNEL = 443, IRC_ERR_NOLOGIN = 444, IRC_ERR_SUMMONDISABLED = 445, IRC_ERR_USERSDISABLED = 446, IRC_ERR_NOTREGISTERED = 451, IRC_ERR_NEEDMOREPARAMS = 461, IRC_ERR_ALREADYREGISTRED = 462, IRC_ERR_NOPERMFORHOST = 463, IRC_ERR_PASSWDMISMATCH = 464, IRC_ERR_YOUREBANNEDCREEP = 465, IRC_ERR_KEYSET = 467, IRC_ERR_CHANNELISFULL = 471, IRC_ERR_UNKNOWNMODE = 472, IRC_ERR_INVITEONLYCHAN = 473, IRC_ERR_BANNEDFROMCHAN = 474, IRC_ERR_BADCHANNELKEY = 475, IRC_ERR_NOCHANMODES = 477, IRC_ERR_NOPRIVILEGES = 481, IRC_ERR_CHANOPRIVSNEEDED = 482, IRC_ERR_CANTKILLSERVER = 483, IRC_ERR_RESTRICTED = 484, IRC_ERR_UNIQOPPRIVSNEEDED = 485, IRC_ERR_NOOPERHOST = 491, IRC_ERR_UMODEUNKNOWNFLAG = 501, IRC_ERR_USERSDONTMATCH = 502, IRC_RPL_NONE = 300, IRC_RPL_AWAY = 301, /* */ IRC_RPL_USERHOST = 302, /* default */ IRC_RPL_ISON = 303, IRC_RPL_UNAWAY = 305, /* */ IRC_RPL_NOWAWAY = 306, /* */ IRC_RPL_WHOISUSER = 311, /* */ IRC_RPL_WHOISSERVER = 312, /* */ IRC_RPL_WHOISOPERATOR = 313, /* */ IRC_RPL_WHOISIDLE = 317, /* */ IRC_RPL_ENDOFWHOIS = 318, /* -- */ IRC_RPL_WHOISCHANNELS = 319, /* */ IRC_RPL_WHOWASUSER = 314, /* */ IRC_RPL_ENDOFWHOWAS = 369, /* -- */ IRC_RPL_LISTSTART = 321, /* -- */ IRC_RPL_LIST = 322, /* */ IRC_RPL_LISTEND = 323, /* -- */ IRC_RPL_CHANNELMODEIS = 324, /* */ IRC_RPL_NOTOPIC = 331, /* d */ IRC_RPL_TOPIC = 332, /* */ IRC_RPL_INVITING = 341, /* */ IRC_RPL_SUMMONING = 342, /* d */ IRC_RPL_VERSION = 351, /* */ IRC_RPL_WHOREPLY = 352, /* */ IRC_RPL_ENDOFWHO = 315, IRC_RPL_NAMREPLY = 353, /* */ IRC_RPL_ENDOFNAMES = 366, IRC_RPL_LINKS = 364, /* */ IRC_RPL_ENDOFLINKS = 365, /* */ IRC_RPL_BANLIST = 367, IRC_RPL_ENDOFBANLIST = 368, IRC_RPL_INFO = 371, /* */ IRC_RPL_ENDOFINFO = 374, IRC_RPL_MOTDSTART = 375, IRC_RPL_MOTD = 372, /* */ IRC_RPL_ENDOFMOTD = 376, IRC_RPL_YOUREOPER = 381, /* d */ IRC_RPL_REHASHING = 382, /* d */ IRC_RPL_TIME = 391, /* */ IRC_RPL_USERSSTART = 392, IRC_RPL_USERS = 393, IRC_RPL_ENDOFUSERS = 394, IRC_RPL_NOUSERS = 395, IRC_RPL_TRACELINK = 200, IRC_RPL_TRACECONNECTING = 201, IRC_RPL_TRACEHANDSHAKE = 202, IRC_RPL_TRACEUNKNOWN = 203, IRC_RPL_TRACEOPERATOR = 204, IRC_RPL_TRACEUSER = 205, IRC_RPL_TRACESERVER = 206, IRC_RPL_TRACENEWTYPE = 208, IRC_RPL_TRACELOG = 261, IRC_RPL_STATSLINKINFO = 211, IRC_RPL_STATSCOMMANDS = 212, IRC_RPL_STATSCLINE = 213, IRC_RPL_STATSNLINE = 214, IRC_RPL_STATSILINE = 215, IRC_RPL_STATSKLINE = 216, IRC_RPL_STATSYLINE = 218, IRC_RPL_ENDOFSTATS = 219, IRC_RPL_STATSLLINE = 241, IRC_RPL_STATSUPTIME = 242, IRC_RPL_STATSOLINE = 243, IRC_RPL_STATSHLINE = 244, IRC_RPL_UMODEIS = 221, IRC_RPL_LUSERCLIENT = 251, IRC_RPL_LUSEROP = 252, IRC_RPL_LUSERUNKNOWN = 253, IRC_RPL_LUSERCHANNELS = 254, IRC_RPL_LUSERME = 255, IRC_RPL_ADMINME = 256, IRC_RPL_ADMINLOC1 = 257, IRC_RPL_ADMINLOC2 = 258, IRC_RPL_ADMINEMAIL = 259, /* undocumented */ IRC_RPL_CREATIONTIME = 329, IRC_RPL_TOPICWHOTIME = 333, IRC_RPL_LOCALUSERS = 265, IRC_RPL_GLOBALUSERS = 266, /* unused? */ IRC_RPL_TRACECLASS = 209, IRC_RPL_SERVICEINFO = 231, IRC_RPL_SERVICE = 233, IRC_RPL_SERVLISTEND = 235, IRC_RPL_WHOISCHANOP = 316, IRC_RPL_CLOSING = 362, IRC_RPL_INFOSTART = 373, IRC_ERR_YOUWILLBEBANNED = 466, IRC_ERR_NOSERVICEHOST = 492, IRC_RPL_STATSQLINE = 217, IRC_RPL_ENDOFSERVICES = 232, IRC_RPL_SERVLIST = 234, IRC_RPL_KILLDONE = 361, IRC_RPL_CLOSEEND = 363, IRC_RPL_MYPORTIS = 384, IRC_ERR_BADCHANMASK = 476, /* new replies. defined by loqui */ IRC_RPL_WELCOME = 1, IRC_RPL_YOURHOST = 2, IRC_RPL_CREATED = 3, IRC_RPL_MYINFO = 4, IRC_RPL_BOUCE = 5, IRC_RPL_HELLO = 20, IRC_RPL_YOURID = 42, IRC_RPL_SAVENICK = 43, IRC_RPL_REOPLIST = 344, IRC_RPL_ENDOFREOPLIST = 345, /* defined by loqui */ IRC_COMMAND_PRIVMSG = 1002, IRC_COMMAND_JOIN = 1003, IRC_COMMAND_NOTICE = 1004, IRC_COMMAND_TOPIC = 1005, IRC_COMMAND_MODE = 1006, IRC_COMMAND_NICK = 1007, IRC_COMMAND_PART = 1008, IRC_COMMAND_QUIT = 1009, IRC_COMMAND_KICK = 1010, IRC_COMMAND_INVITE = 1011, IRC_COMMAND_ERROR = 1012, IRC_COMMAND_PASS = 1013, IRC_COMMAND_USER = 1015, IRC_COMMAND_OPER = 1016, IRC_COMMAND_SQUIT = 1017, IRC_COMMAND_STATS = 1018, IRC_COMMAND_LINKS = 1019, IRC_COMMAND_TIME = 1020, IRC_COMMAND_CONNECT = 1021, IRC_COMMAND_TRACE = 1022, IRC_COMMAND_ADMIN = 1023, IRC_COMMAND_INFO = 1024, IRC_COMMAND_WHO = 1026, IRC_COMMAND_WHOIS = 1027, IRC_COMMAND_WHOWAS = 1028, IRC_COMMAND_KILL = 1029, IRC_COMMAND_PING = 1030, IRC_COMMAND_PONG = 1031, IRC_COMMAND_AWAY = 1032, IRC_COMMAND_REHASH = 1033, IRC_COMMAND_RESTART = 1034, IRC_COMMAND_SUMMON = 1035, IRC_COMMAND_USERS = 1036, IRC_COMMAND_USERHOST = 1037, IRC_COMMAND_ISON = 1038, IRC_COMMAND_OBJECT = 1039, } IRCResponse; /* IRC Commands */ #define IRCCTCPVersion "VERSION" #define IRCCTCPPing "PING" #define IRCCTCPClientInfo "CLIENTINFO" #define IRCCTCPUserInfo "USERINFO" #define IRCCTCPTime "TIME" #define IRCCTCPFinger "FINGER" #define IRCCTCPDCC "DCC" #define IRCCTCPAction "ACTION" #define IRCDCCSend "SEND" #define IRCDCCChat "CHAT" #define IRCCommandPrivmsg "PRIVMSG" #define IRCCommandJoin "JOIN" #define IRCCommandNotice "NOTICE" #define IRCCommandTopic "TOPIC" #define IRCCommandMode "MODE" #define IRCCommandNick "NICK" #define IRCCommandPart "PART" #define IRCCommandQuit "QUIT" #define IRCCommandKick "KICK" #define IRCCommandInvite "INVITE" #define IRCCommandError "ERROR" #define IRCCommandPass "PASS" #define IRCCommandUser "USER" #define IRCCommandOper "OPER" #define IRCCommandSQuit "SQUIT" #define IRCCommandStats "STATS" #define IRCCommandLinks "LINKS" #define IRCCommandTime "TIME" #define IRCCommandConnect "CONNECT" #define IRCCommandTrace "TRACE" #define IRCCommandAdmin "ADMIN" #define IRCCommandInfo "INFO" #define IRCCommandWho "WHO" #define IRCCommandWhois "WHOIS" #define IRCCommandWhowas "WHOWAS" #define IRCCommandKill "KILL" #define IRCCommandPing "PING" #define IRCCommandPong "PONG" #define IRCCommandAway "AWAY" #define IRCCommandRehash "REHASH" #define IRCCommandRestart "RESTART" #define IRCCommandSummon "SUMMON" #define IRCCommandUsers "USERS" #define IRCCommandUserhost "USERHOST" #define IRCCommandIson "ISON" #define IRCCommandObject "OBJECT" #endif /* __LOQUI_IRC_CONSTANTS__ */ loqui-0.7.0/libloqui/irc_message.c000066400000000000000000000317111401145342000171110ustar00rootroot00000000000000/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * libloqui -- Chat/IM client library for GLib * Copyright (C) 2002-2004 Yoichi Imai * * This Library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This Library 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with the Gnome Library; see the file COPYING.LIB. If not, * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #include "config.h" #include "irc_message.h" #include "loqui-utils.h" #include "irc_constants.h" #include #include #include typedef struct { gchar *command; IRCResponse response; } CommandItem; static CommandItem command_table[] = { {IRCCommandPing, IRC_COMMAND_PING}, {IRCCommandPrivmsg, IRC_COMMAND_PRIVMSG}, {IRCCommandJoin, IRC_COMMAND_JOIN}, {IRCCommandNotice, IRC_COMMAND_NOTICE}, {IRCCommandTopic, IRC_COMMAND_TOPIC}, {IRCCommandMode, IRC_COMMAND_MODE}, {IRCCommandNick, IRC_COMMAND_NICK}, {IRCCommandPart, IRC_COMMAND_PART}, {IRCCommandQuit, IRC_COMMAND_QUIT}, {IRCCommandKick, IRC_COMMAND_KICK}, {IRCCommandInvite, IRC_COMMAND_INVITE}, {IRCCommandError, IRC_COMMAND_ERROR}, {IRCCommandPass, IRC_COMMAND_PASS}, {IRCCommandNick, IRC_COMMAND_NICK}, {IRCCommandUser, IRC_COMMAND_USER}, {IRCCommandOper, IRC_COMMAND_OPER}, {IRCCommandSQuit, IRC_COMMAND_SQUIT}, {IRCCommandStats, IRC_COMMAND_STATS}, {IRCCommandLinks, IRC_COMMAND_LINKS}, {IRCCommandTime, IRC_COMMAND_TIME}, {IRCCommandConnect, IRC_COMMAND_CONNECT}, {IRCCommandTrace, IRC_COMMAND_TRACE}, {IRCCommandAdmin, IRC_COMMAND_ADMIN}, {IRCCommandInfo, IRC_COMMAND_INFO}, {IRCCommandNotice, IRC_COMMAND_NOTICE}, {IRCCommandWho, IRC_COMMAND_WHO}, {IRCCommandWhois, IRC_COMMAND_WHOIS}, {IRCCommandWhowas, IRC_COMMAND_WHOWAS}, {IRCCommandKill, IRC_COMMAND_KILL}, {IRCCommandPing, IRC_COMMAND_PING}, {IRCCommandPong, IRC_COMMAND_PONG}, {IRCCommandAway, IRC_COMMAND_AWAY}, {IRCCommandRehash, IRC_COMMAND_REHASH}, {IRCCommandRestart, IRC_COMMAND_RESTART}, {IRCCommandSummon, IRC_COMMAND_SUMMON}, {IRCCommandUsers, IRC_COMMAND_USERS}, {IRCCommandUserhost, IRC_COMMAND_USERHOST}, {IRCCommandIson, IRC_COMMAND_ISON}, {IRCCommandObject, IRC_COMMAND_OBJECT}, {NULL, 0} }; struct _IRCMessagePrivate { }; static GObjectClass *parent_class = NULL; #define PARENT_TYPE G_TYPE_OBJECT static void irc_message_class_init(IRCMessageClass *klass); static void irc_message_init(IRCMessage *irc_message); static void irc_message_finalize(GObject *object); /* this function returns TRUE if str is nick!user@host Then nick, user and host must be freed. */ static gboolean irc_message_parse_prefix(const gchar *str, gchar **nick, gchar **user, gchar **host); GType irc_message_get_type(void) { static GType type = 0; if (type == 0) { static const GTypeInfo our_info = { sizeof(IRCMessageClass), NULL, /* base_init */ NULL, /* base_finalize */ (GClassInitFunc) irc_message_class_init, NULL, /* class_finalize */ NULL, /* class_data */ sizeof(IRCMessage), 0, /* n_preallocs */ (GInstanceInitFunc) irc_message_init }; type = g_type_register_static(PARENT_TYPE, "IRCMessage", &our_info, 0); } return type; } static void irc_message_class_init(IRCMessageClass *klass) { int i; GObjectClass *object_class = G_OBJECT_CLASS(klass); parent_class = g_type_class_peek_parent(klass); object_class->finalize = irc_message_finalize; klass->command_hash = g_hash_table_new(g_str_hash, g_str_equal); for(i = 0; command_table[i].command != NULL; i++) { g_hash_table_insert(klass->command_hash, (gpointer) command_table[i].command, GINT_TO_POINTER(command_table[i].response)); } } static void irc_message_init(IRCMessage *irc_message) { IRCMessagePrivate *priv; priv = g_new0(IRCMessagePrivate, 1); irc_message->priv = priv; } static void irc_message_finalize(GObject *object) { IRCMessage *msg; g_return_if_fail(object != NULL); g_return_if_fail(IS_IRC_MESSAGE(object)); msg = IRC_MESSAGE(object); LOQUI_G_FREE_UNLESS_NULL(msg->prefix); LOQUI_G_FREE_UNLESS_NULL(msg->command); LOQUI_G_FREE_UNLESS_NULL(msg->nick); LOQUI_G_FREE_UNLESS_NULL(msg->user); LOQUI_G_FREE_UNLESS_NULL(msg->host); if (msg->parameter) { g_strfreev(msg->parameter); msg->parameter = NULL; } if (G_OBJECT_CLASS(parent_class)->finalize) (* G_OBJECT_CLASS(parent_class)->finalize) (object); g_free(msg->priv); } static gboolean irc_message_parse_prefix(const gchar *str, gchar **nick, gchar **user, gchar **host) { gchar *s, *t, *buf; g_return_val_if_fail(str != NULL, FALSE); g_return_val_if_fail(nick != NULL, FALSE); g_return_val_if_fail(user != NULL, FALSE); g_return_val_if_fail(host != NULL, FALSE); *nick = NULL; *user = NULL; *host = NULL; buf = t = g_strdup(str); s = strchr(t, '!'); if(!s) { g_free(buf); return FALSE; } *s = '\0'; *nick = g_strdup(t); t = ++s; s = strchr(t, '@'); if(!s) { g_free(*nick); *nick = NULL; g_free(buf); return FALSE; } *s = '\0'; *user = g_strdup(t); t = ++s; *host = g_strdup(t); return TRUE; } IRCMessage* irc_message_new(const gchar *prefix, const gchar *command, gchar **parameter) { IRCMessage *msg; IRCMessageClass *klass; g_return_val_if_fail(command != NULL, NULL); g_return_val_if_fail(parameter != NULL, NULL); msg = g_object_new(irc_message_get_type(), NULL); if(prefix) { msg->prefix = g_strdup(prefix); irc_message_parse_prefix(prefix, &msg->nick, &msg->user, &msg->host); } else msg->prefix = NULL; msg->command = g_utf8_strup(command, -1); msg->parameter = g_strdupv(parameter); msg->response = (int) g_ascii_strtoull(command, NULL, 10); if(msg->response == 0) { klass = IRC_MESSAGE_GET_CLASS(msg); msg->response = GPOINTER_TO_INT(g_hash_table_lookup(klass->command_hash, msg->command)); } return msg; } gchar * irc_message_inspect(IRCMessage *msg) { int i; GString *string; gchar *str; g_return_val_if_fail(msg != NULL, NULL); g_return_val_if_fail(IS_IRC_MESSAGE(msg), NULL); string = g_string_new(NULL); g_string_printf(string, "command: %s(%d), prefix: %s", msg->command, msg->response, msg->prefix); if(msg->prefix != NULL) { if(msg->nick) { g_string_append_printf(string, "(nick: %s, user: %s, host: %s)", msg->nick, msg->user, msg->host); } else { g_string_append_printf(string, "(server: %s)", msg->prefix); } } g_string_append(string, ", args: ["); for(i = 0; msg->parameter[i] != NULL; i++) { g_string_append_printf(string, "'%s'", msg->parameter[i]); if(msg->parameter[i+1] != NULL) g_string_append_printf(string, ", "); } g_string_append(string, "]"); str = string->str; g_string_free(string, FALSE); return str; } void irc_message_print(IRCMessage *msg) { gchar *str; g_return_if_fail(msg != NULL); g_return_if_fail(IS_IRC_MESSAGE(msg)); str = irc_message_inspect(msg); g_print("%s\n", str); g_free(str); } IRCMessage* irc_message_parse_line(const gchar *line) { IRCMessage *msg; gchar *array[20]; gchar *prefix = NULL, *command = NULL, *parameter[16]; int i = 0, num, start; gchar *buf; gchar *cur, *tmp; g_return_val_if_fail(line != NULL, NULL); buf = g_strdup(line); loqui_utils_remove_return_code(buf); if(buf == NULL || *buf == '\0') { loqui_debug_puts("Empty line was sent by server."); return NULL; } cur = buf; while((tmp = strchr(cur, ' ')) != NULL) { while(*tmp == ' ') { *tmp = '\0'; tmp++; } if(*tmp == '\0') break; array[i++] = cur; cur = tmp; /* FIXME: if the message has prefix, this can parse IRC_MESSAGE_PARAMETER_MAX - 1 */ if(i >= IRC_MESSAGE_PARAMETER_MAX) break; if(*cur == ':') { cur++; break; } } array[i++] = cur; num = i; if(num < 1) { loqui_debug_puts("No prefix/command/parameters given: '%s'.", line); g_free(buf); return NULL; } if(*array[0] == ':') { prefix = array[0]+1; command = array[1]; start = 2; } else { prefix = NULL; command = array[0]; start = 1; } for(i = start; i < num; i++) { parameter[i-start] = array[i]; } parameter[i-start] = NULL; msg = irc_message_new(prefix, command, parameter); g_free(buf); return msg; } IRCMessage * irc_message_create(const gchar *command, const gchar *param, ...) { IRCMessage *msg; va_list args; gint num, i; gchar **strings; va_start(args, param); for(num = 0; va_arg(args, gchar *); num++); /* count numbers */ va_end(args); strings = g_new(gchar *, num + 2); strings[0] = (gchar *) param; /* FIXME: originally this needn't cast */ va_start(args, param); for(i = 1; i < num+1; i++) { strings[i] = va_arg(args, gchar *); } strings[i] = NULL; va_end(args); msg = irc_message_new(NULL, command, strings); g_free(strings); return msg; } IRCMessage * irc_message_createv(const gchar *command, gchar *param_array[]) { return irc_message_new(NULL, command, param_array); } gchar * irc_message_to_string(IRCMessage *msg) { GString *string; gchar *str; gint i, num; g_return_val_if_fail(msg != NULL, NULL); g_return_val_if_fail(IS_IRC_MESSAGE(msg), NULL); g_return_val_if_fail(msg->command != NULL, NULL); g_return_val_if_fail(msg->parameter != NULL, NULL); num = irc_message_count_parameters(msg); string = g_string_new(msg->command); if(num > 0) { for(i = 0; i < num - 1; i++) { g_string_append_c(string, ' '); g_string_append(string, msg->parameter[i]); } // only if the last parameter has (' ') or empty (""), add ':' (for madoka) if (strlen(msg->parameter[i]) > 0 && strchr(msg->parameter[i], ' ') == NULL) { g_string_append_printf(string, " %s", msg->parameter[i]); } else { g_string_append_printf(string, " :%s", msg->parameter[i]); } } str = string->str; g_string_free(string, FALSE); return str; } gint irc_message_count_parameters(IRCMessage *msg) { gint num; for(num = 0; msg->parameter[num] != NULL; num++); return num; } gchar * irc_message_get_target(IRCMessage *msg) { if (irc_message_count_parameters(msg) == 0) return 0; return msg->parameter[IRC_MESSAGE_PARAM_INDEX_TARGET]; } gchar * irc_message_get_last_param(IRCMessage *msg) { guint num; num = irc_message_count_parameters(msg); if (num < 1) return NULL; return msg->parameter[num-1]; } gchar * irc_message_get_param(IRCMessage *msg, guint i) { int num; g_return_val_if_fail(0 <= i && i < IRC_MESSAGE_PARAMETER_MAX, NULL); num = irc_message_count_parameters(msg); if (num < i) { g_warning(_("Invalid parameter number")); return NULL; } return msg->parameter[i]; } gchar * irc_message_format(IRCMessage *msg, const gchar *format) { GString *string; const gchar *cur; gchar *tmp, *buf, *s; guint64 i, end; g_return_val_if_fail(msg != NULL, NULL); g_return_val_if_fail(IS_IRC_MESSAGE(msg), NULL); g_return_val_if_fail(format != NULL, NULL); string = g_string_new_len(NULL, strlen(format)); cur = format; while((tmp = strchr(cur, '%')) != NULL) { if(tmp > cur) { string = g_string_append_len(string, cur, tmp - cur); cur = tmp; } cur++; if(*cur == '\0') break; if((i = g_ascii_strtoull(cur, &tmp, 10)) != 0) { buf = irc_message_get_param(msg, i); string = g_string_append(string, buf); cur = tmp; continue; } switch(*cur) { case '*': /* %*n : all params after n */ cur++; i = g_ascii_strtoull(cur, &tmp, 10); if (cur == tmp) break; cur = tmp; end = irc_message_count_parameters(msg) - 1; for(; i < end; i++) { string = g_string_append(string, irc_message_get_param(msg, i)); string = g_string_append_c(string, ' '); } string = g_string_append(string, irc_message_get_param(msg, i)); /* not to append space at last */ break; case 'n': /* nick */ string = g_string_append(string, msg->nick); cur++; break; case 'u': /* user */ string = g_string_append(string, msg->user); cur++; break; case 'h': /* host */ string = g_string_append(string, msg->host); cur++; break; case 'L': /* last */ s = irc_message_get_last_param(msg); if (s != NULL) string = g_string_append(string, s); cur++; break; case 't': /* target,msgto */ s = irc_message_get_target(msg); if (s != NULL) string = g_string_append(string, s); cur++; break; case '%': /* %% */ string = g_string_append_c(string, '%'); cur++; break; default: cur++; break; } } string = g_string_append(string, cur); tmp = string->str; g_string_free(string, FALSE); return tmp; } loqui-0.7.0/libloqui/irc_message.h000066400000000000000000000064531401145342000171230ustar00rootroot00000000000000/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * libloqui -- Chat/IM client library for GLib * Copyright (C) 2002-2004 Yoichi Imai * * This Library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This Library 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with the Gnome Library; see the file COPYING.LIB. If not, * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #ifndef __IRC_MESSAGE_H__ #define __IRC_MESSAGE_H__ #include #include #include "irc_constants.h" G_BEGIN_DECLS #define TYPE_IRC_MESSAGE (irc_message_get_type ()) #define IRC_MESSAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_IRC_MESSAGE, IRCMessage)) #define IRC_MESSAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_IRC_MESSAGE, IRCMessageClass)) #define IS_IRC_MESSAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_IRC_MESSAGE)) #define IS_IRC_MESSAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_IRC_MESSAGE)) #define IRC_MESSAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_IRC_MESSAGE, IRCMessageClass)) typedef struct _IRCMessage IRCMessage; typedef struct _IRCMessageClass IRCMessageClass; typedef struct _IRCMessagePrivate IRCMessagePrivate; #define IRC_MESSAGE_IS_COMMAND(msg) (msg->response > 1000) #define IRC_MESSAGE_IS_REPLY(msg) (msg->response < 100 || (200 < msg->response && msg->response < 400)) #define IRC_MESSAGE_IS_ERROR(msg) ((400 < msg->response && msg->response < 1000)) #define IRC_MESSAGE_PARAM_INDEX_TARGET 0 struct _IRCMessage { GObject parent; gchar *prefix; /* if prefix != NULL or prefix != server, these variables are set. */ gchar *nick; gchar *user; gchar *host; IRCResponse response; gchar *command; gchar **parameter; IRCMessagePrivate *priv; }; struct _IRCMessageClass { GObjectClass parent_class; GHashTable *command_hash; }; GType irc_message_get_type (void) G_GNUC_CONST; IRCMessage* irc_message_new(const gchar *prefix, const gchar *command, gchar **parameter); gchar* irc_message_get_param(IRCMessage *msg, guint i); /* 0 <= i < IRC_MESSAGE_MAX */ gchar* irc_message_get_target(IRCMessage *msg); gchar* irc_message_get_last_param(IRCMessage *msg); gint irc_message_count_parameters(IRCMessage *msg); IRCMessage* irc_message_parse_line(const gchar *line); gchar* irc_message_inspect(IRCMessage *msg); void irc_message_print(IRCMessage *msg); IRCMessage* irc_message_create(const gchar *command, const gchar *param, ...); IRCMessage* irc_message_createv(const gchar *command, gchar *param_array[]); gchar* irc_message_to_string(IRCMessage *msg); gchar* irc_message_format(IRCMessage *msg, const gchar *format); G_END_DECLS #endif /* __IRC_MESSAGE_H__ */ loqui-0.7.0/libloqui/libloqui-intl.h000066400000000000000000000001261401145342000174150ustar00rootroot00000000000000#undef GETTEXT_PACKAGE #define GETTEXT_PACKAGE "libloqui" #include loqui-0.7.0/libloqui/loqui-account-ipmsg.gob000066400000000000000000000130051401145342000210510ustar00rootroot00000000000000requires 2.0.0 %alltop{ /* * libloqui -- Chat/IM client library for GLib * Copyright (C) 2004 Yoichi Imai * * This Library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This Library 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with the Gnome Library; see the file COPYING.LIB. If not, * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ %} %h{ #include "loqui_account.h" #include "ipmsg_packet.h" #include "loqui-socket-ipmsg.h" #include "loqui_user_ipmsg.h" %} %{ #include #include "loqui-utils.h" #include "loqui-sender-ipmsg.h" #include "loqui-receiver-ipmsg.h" #include "loqui-utils-ipmsg.h" #include "ipmsg_packet.h" #include "ipmsg.h" %} class Loqui:Account:IPMsg from Loqui:Account { private LoquiSocketIPMsg *sock; private gint current_packet_num = { (gint) time(NULL) }; override (G:Object) GObject * constructor(GType type, guint n_props, GObjectConstructParam *props) { GObject *object; LoquiAccount *account; LoquiUser *user; object = PARENT_HANDLER(type, n_props, props); account = LOQUI_ACCOUNT(object); loqui_account_set_sender(account, LOQUI_SENDER(loqui_sender_ipmsg_new(account))); loqui_account_set_receiver(account, LOQUI_RECEIVER(loqui_receiver_ipmsg_new(account))); user = LOQUI_USER(loqui_user_ipmsg_new()); loqui_user_set_away(user, LOQUI_AWAY_TYPE_OFFLINE); loqui_account_set_user_self(account, user); return object; } override (Loqui:Account) void connect(Loqui:Account *account) { Self *self; LoquiUser *user_self; gchar *str; self = SELF(account); if (loqui_account_get_is_connected(LOQUI_ACCOUNT(self))) { loqui_account_warning(LOQUI_ACCOUNT(self), _("Already connected.")); return; } selfp->sock = loqui_socket_ipmsg_new(account); if (!loqui_socket_ipmsg_bind(selfp->sock)) { loqui_account_warning(LOQUI_ACCOUNT(self), _("Failed to create socket. Is used the port?")); LOQUI_G_OBJECT_UNREF_UNLESS_NULL(selfp->sock); return; } loqui_account_set_is_connected(LOQUI_ACCOUNT(self), TRUE); str = g_strdup_printf(_("Opened the socket.")); loqui_account_append_text(LOQUI_ACCOUNT(self), NULL, LOQUI_TEXT_TYPE_INFO, str); g_free(str); user_self = loqui_account_get_user_self(LOQUI_ACCOUNT(self)); loqui_user_set_away(user_self, LOQUI_AWAY_TYPE_ONLINE); loqui_user_set_nick(user_self, loqui_profile_account_get_nick(loqui_account_get_profile(LOQUI_ACCOUNT(self)))); loqui_user_set_hostname(user_self, g_get_host_name()); /* FIXME: can't get ? tmp = loqui_socket_ipmsg_get_current_ip_addr(selfp->sock); loqui_user_ipmsg_set_ip_addr(LOQUI_USER_IPMSG(user_self), tmp); g_free(tmp); */ loqui_user_ipmsg_set_ip_addr(LOQUI_USER_IPMSG(user_self), "127.0.0.1"); loqui_user_ipmsg_set_port(LOQUI_USER_IPMSG(user_self), loqui_socket_ipmsg_get_current_port(selfp->sock)); /* FIXME: originally this should do in UserIPMsg */ g_object_notify(G_OBJECT(user_self), "identifier"); loqui_sender_ipmsg_br_entry(LOQUI_SENDER_IPMSG(LOQUI_ACCOUNT(self)->sender)); } override (Loqui:Account) void disconnect(Loqui:Account *account) { Self *self; self = SELF(account); if (!loqui_account_get_is_connected(LOQUI_ACCOUNT(account))) return; loqui_account_remove_all_user(LOQUI_ACCOUNT(account)); loqui_sender_ipmsg_br_exit(LOQUI_SENDER_IPMSG(LOQUI_ACCOUNT(self)->sender)); if (selfp->sock) loqui_socket_ipmsg_unbind(selfp->sock); LOQUI_G_OBJECT_UNREF_UNLESS_NULL(selfp->sock); loqui_account_append_text(account, NULL, LOQUI_TEXT_TYPE_INFO, _("Disconnected.")); loqui_account_set_is_connected(LOQUI_ACCOUNT(account), FALSE); loqui_user_set_away(loqui_account_get_user_self(LOQUI_ACCOUNT(account)), LOQUI_AWAY_TYPE_OFFLINE); } public LoquiAccountIPMsg * new(LoquiProfileAccount *profile) { Self *self = g_object_new(TYPE_SELF, "profile", profile, NULL); return self; } public LoquiSocketIPMsg *get_socket(self) { return selfp->sock; } public IPMsgPacket *create_packet(self, gint command_num, const gchar *extra) { LoquiUser *user; LoquiProfileAccount *profile; user = loqui_account_get_user_self(LOQUI_ACCOUNT(self)); profile = loqui_account_get_profile(LOQUI_ACCOUNT(self)); return ipmsg_packet_create(IPMSG_VERSION, selfp->current_packet_num++, loqui_profile_account_get_username(profile), loqui_user_get_hostname(user), command_num, extra, loqui_user_ipmsg_get_group_name(LOQUI_USER_IPMSG(user))); } public LoquiUserIPMsg *fetch_user_by_pair(self, const gchar *ip_addr, gint port) { gchar *identifier; LoquiUser *user; identifier = loqui_utils_ipmsg_create_identifier(ip_addr, port); if ((user = loqui_account_peek_user(LOQUI_ACCOUNT(self), identifier)) == NULL) { user = LOQUI_USER(loqui_user_ipmsg_new()); loqui_user_ipmsg_set_ip_addr(LOQUI_USER_IPMSG(user), ip_addr); loqui_user_ipmsg_set_port(LOQUI_USER_IPMSG(user), port); loqui_account_add_user(LOQUI_ACCOUNT(self), user); } else { g_object_ref(user); } g_free(identifier); return LOQUI_USER_IPMSG(user); } } loqui-0.7.0/libloqui/loqui-account-manager.gob000066400000000000000000000246141401145342000213540ustar00rootroot00000000000000requires 2.0.0 %alltop{ /* * libloqui -- Chat/IM client library for GLib * Copyright (C) 2005 Yoichi Imai * * This Library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This Library 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with the Gnome Library; see the file COPYING.LIB. If not, * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ %} %h{ #include "loqui_account.h" #include "loqui_channel.h" #include "loqui_protocol_manager.h" %} %{ #include "loqui-account-manager-private.h" #include "config.h" #include #include "loqui_account.h" #include "loqui-utils.h" #include "loqui-profile-handle.h" #include "loqui_account_manager_iter.h" #include "loqui-static-core.h" #define ACCOUNT_CONFIG_FILENAME "account.xml" %} class Loqui:Account:Manager from G:Object { public LoquiProtocolManager *protocol_manager = NULL unrefwith g_object_unref; public gint max_channel_entry_id; private GList *account_list; override (G:Object) void dispose(GObject *object) { Self *self; self = SELF(object); self_remove_all_account(self); PARENT_HANDLER(object); } /* signals */ signal last NONE (OBJECT) void add_account(self, Loqui:Account *account (check null type)) { self_add_channel_entry(self, LOQUI_CHANNEL_ENTRY(account)); selfp->account_list = g_list_append(selfp->account_list, g_object_ref(account)); g_signal_connect(G_OBJECT(account), "add-channel", G_CALLBACK(self_add_channel_cb), self); g_signal_connect_after(G_OBJECT(account), "add-channel", G_CALLBACK(self_add_channel_after_cb), self); g_signal_connect(G_OBJECT(account), "remove-channel", G_CALLBACK(self_remove_channel_cb), self); g_signal_connect_after(G_OBJECT(account), "remove-channel", G_CALLBACK(self_remove_channel_after_cb), self); self_add_channel_entry_after(self, LOQUI_CHANNEL_ENTRY(account)); } signal last NONE (OBJECT) void remove_account(self, Loqui:Account *account (check null type)) { self_remove_channel_entry(self, LOQUI_CHANNEL_ENTRY(account)); g_signal_handlers_disconnect_by_func(G_OBJECT(account), self_add_channel_cb, self); g_signal_handlers_disconnect_by_func(G_OBJECT(account), self_add_channel_after_cb, self); g_signal_handlers_disconnect_by_func(G_OBJECT(account), self_remove_channel_cb, self); g_signal_handlers_disconnect_by_func(G_OBJECT(account), self_remove_channel_after_cb, self); selfp->account_list = g_list_remove(selfp->account_list, account); g_object_unref(account); self_remove_channel_entry_after(self, LOQUI_CHANNEL_ENTRY(account)); } /* utility signals */ signal last NONE (OBJECT) void add_channel_entry(self, Loqui:Channel:Entry *chent) { loqui_channel_entry_set_id(chent, self_new_channel_entry_id(self)); } signal last NONE (OBJECT) void add_channel_entry_after(self, Loqui:Channel:Entry *chent) { self_update_positions(self); } signal last NONE (OBJECT) void remove_channel_entry(self, Loqui:Channel:Entry *chent) { } signal last NONE (OBJECT) void remove_channel_entry_after(self, Loqui:Channel:Entry *chent) { self_update_positions(self); } public LoquiAccountManager* new(LoquiProtocolManager *protocol_manager) { Self *self; self = GET_NEW; self->protocol_manager = g_object_ref(protocol_manager); return self; } private void add_channel_cb(LoquiAccount *account, LoquiChannel *channel, Loqui:Account:Manager *self) { self_add_channel_entry(self, LOQUI_CHANNEL_ENTRY(channel)); } private void add_channel_after_cb(LoquiAccount *account, LoquiChannel *channel, Loqui:Account:Manager *self) { self_add_channel_entry_after(self, LOQUI_CHANNEL_ENTRY(channel)); } private void remove_channel_cb(LoquiAccount *account, LoquiChannel *channel, Loqui:Account:Manager *self) { self_remove_channel_entry(self, LOQUI_CHANNEL_ENTRY(channel)); } private void remove_channel_after_cb(LoquiAccount *account, LoquiChannel *channel, Loqui:Account:Manager *self) { self_remove_channel_entry_after(self, LOQUI_CHANNEL_ENTRY(channel)); } public void remove_all_account(self) { GList *list; list = g_list_copy(selfp->account_list); loqui_utils_g_list_foreach_swapped(list, (GFunc) self_remove_account, self); g_list_free(list); } public void load_accounts(self) { GList *cur, *list = NULL; gchar *path; LoquiProfileHandle *handle; LoquiAccount *account; LoquiProfileAccount *profile; GList *factory_list; path = g_build_filename(loqui_core_get_user_dir(loqui_get_core()), ACCOUNT_CONFIG_FILENAME, NULL); factory_list = loqui_protocol_manager_get_protocol_list(self->protocol_manager); handle = loqui_profile_handle_new(factory_list); g_list_free(factory_list); loqui_profile_handle_read_from_file(handle, &list, path); for(cur = list; cur != NULL; cur = cur->next) { profile = LOQUI_PROFILE_ACCOUNT(cur->data); account = loqui_protocol_create_account(profile->protocol, profile); self_add_account(self, account); g_object_unref(account); } g_list_free(list); g_object_unref(handle); } public void save_accounts(self) { GList *cur; GList *list = NULL; gchar *path; LoquiProfileHandle *handle; GList *factory_list; for(cur = selfp->account_list; cur != NULL; cur = cur->next) { list = g_list_append(list, loqui_account_get_profile(cur->data)); } path = g_build_filename(loqui_core_get_user_dir(loqui_get_core()), ACCOUNT_CONFIG_FILENAME, NULL); factory_list = loqui_protocol_manager_get_protocol_list(self->protocol_manager); handle = loqui_profile_handle_new(factory_list); g_list_free(factory_list); loqui_profile_handle_write_to_file(handle, list, path); g_object_unref(handle); g_list_free(list); } public void disconnect_all(self) { g_list_foreach(selfp->account_list, (GFunc) loqui_account_disconnect, NULL); } public GList * get_account_list(self) { return selfp->account_list; } public void connect_all_default(self) { GList *cur; LoquiAccount *account; for (cur = selfp->account_list; cur != NULL; cur = cur->next) { account = LOQUI_ACCOUNT(cur->data); if (loqui_account_get_is_connected(account)) continue; if (!loqui_profile_account_get_use(loqui_account_get_profile(account))) continue; loqui_account_connect(account); } } /** * get_next_channel_entry: * * Returns the next channel entry. * * @chent: ChannelEntry or NULL * @returns: a channel entry or NULL(not changed) */ public LoquiChannelEntry * get_next_channel_entry(self, LoquiChannelEntry *chent, gboolean require_unread) { LoquiAccountManagerIter iter, iter_chent; gboolean is_exist; LoquiChannelEntry *tmp_chent; loqui_account_manager_iter_init(self, &iter); if (chent) is_exist = loqui_account_manager_iter_set_channel_entry(&iter, chent); else is_exist = FALSE; iter_chent = iter; if (is_exist) { loqui_account_manager_iter_channel_entry_next(&iter); while ((tmp_chent = loqui_account_manager_iter_channel_entry_next(&iter))) { if (!require_unread || loqui_channel_entry_get_whether_unread(tmp_chent)) return tmp_chent; } } loqui_account_manager_iter_set_first_channel_entry(&iter); while ((tmp_chent = loqui_account_manager_iter_channel_entry_next(&iter))) { if (!require_unread || loqui_channel_entry_get_whether_unread(tmp_chent)) return tmp_chent; } return NULL; } public LoquiChannelEntry * get_previous_channel_entry(self, LoquiChannelEntry *chent, gboolean require_unread) { LoquiAccountManagerIter iter; gboolean is_exist; LoquiChannelEntry *tmp_chent; loqui_account_manager_iter_init(self, &iter); if (chent) is_exist = loqui_account_manager_iter_set_channel_entry(&iter, chent); else is_exist = FALSE; if (is_exist) { loqui_account_manager_iter_channel_entry_previous(&iter); while ((tmp_chent = loqui_account_manager_iter_channel_entry_previous(&iter))) { if (!require_unread || loqui_channel_entry_get_whether_unread(tmp_chent)) return tmp_chent; } } loqui_account_manager_iter_set_last_channel_entry(&iter); while ((tmp_chent = loqui_account_manager_iter_channel_entry_previous(&iter))) { if (!require_unread || loqui_channel_entry_get_whether_unread(tmp_chent)) return tmp_chent; } return NULL; } public gint new_channel_entry_id(self) { return ++self->max_channel_entry_id; } public void update_positions(self) { LoquiAccountManagerIter iter; LoquiChannelEntry *chent; gint i; i = 0; loqui_account_manager_iter_init(self, &iter); loqui_account_manager_iter_set_first_channel_entry(&iter); while ((chent = loqui_account_manager_iter_channel_entry_next(&iter))) { loqui_channel_entry_set_position(chent, i); i++; } } } loqui-0.7.0/libloqui/loqui-core.gob000066400000000000000000000066741401145342000172460ustar00rootroot00000000000000requires 2.0.0 %alltop{ /* * libloqui -- Chat/IM client library for GLib * Copyright (C) 2004 Yoichi Imai * * This Library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This Library 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with the Gnome Library; see the file COPYING.LIB. If not, * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ %} %{ #include "config.h" #include #include "loqui-utils.h" #include "loqui-static-core.h" %} %h{ #include #include %} class Loqui:Core from G:Object { public gboolean debug_mode = FALSE; public gboolean show_msg_mode = FALSE; public gboolean send_status_commands_mode = TRUE; public gchar *user_dir = NULL unrefwith g_free; public LoquiPref *general_pref = { loqui_pref_new(); } unrefwith g_object_unref; public LoquiNotifier *notifier = { loqui_notifier_new(); } unrefwith g_object_unref; init(self) { self_set_user_dir(self, NULL); } /** run from loqui_init(). */ public virtual void initialize(self) { #if !GLIB_CHECK_VERSION(2, 31, 0) if(!g_threads_got_initialized) g_thread_init (NULL); #endif } public LoquiCore * new(void) { LoquiCore *ret = GET_NEW; return ret; } public gchar *get_library_version(self) { return g_strdup(VERSION); } public virtual gchar *get_version_info(self) { gchar *ver, *str; ver = self_get_library_version(self); str = g_strdup_printf("libloqui %s", ver); g_free(ver); return str; } public void set_debug_mode(self, gboolean debug_mode) { self->debug_mode = debug_mode; } public gboolean get_debug_mode(self) { return self->debug_mode; } public void set_show_msg_mode(self, gboolean show_msg_mode) { self->show_msg_mode = show_msg_mode; } public gboolean get_show_msg_mode(self) { return self->show_msg_mode; } public void set_send_status_commands_mode(self, gboolean send_status_commands_mode) { self->send_status_commands_mode = send_status_commands_mode; } public gboolean get_send_status_commands_mode(self) { return self->send_status_commands_mode; } public void set_user_dir(self, const gchar *path) { const gchar *env_userdir; if (self->user_dir) { g_free(self->user_dir); self->user_dir = NULL; } if (path) { self->user_dir = g_strdup(path); } else { if ((env_userdir = g_getenv(LOQUI_USER_DIR_ENV_KEY)) != NULL) self->user_dir = g_strdup(env_userdir); else self->user_dir = g_build_filename(g_get_home_dir(), LOQUI_USER_DIR_DEFAULT_BASENAME, NULL); } } public const gchar *get_user_dir(self) { return self->user_dir; } public LoquiPref *get_general_pref(self) { return self->general_pref; } public void set_notifier(self, Loqui:Notifier *notifier (check type null)) { LOQUI_G_OBJECT_UNREF_UNLESS_NULL(self->notifier); self->notifier = g_object_ref(notifier); } public LoquiNotifier * get_notifier(self) { return self->notifier; } } loqui-0.7.0/libloqui/loqui-general-pref-default.h000066400000000000000000000013311401145342000217500ustar00rootroot00000000000000#define LOQUI_GENERAL_PREF_DEFAULT_ACCOUNT_AUTO_RECONNECT TRUE #define LOQUI_GENERAL_PREF_DEFAULT_IGNORE_USE_NORMAL_IGNORE TRUE #define LOQUI_GENERAL_PREF_DEFAULT_IGNORE_USE_TRANSPARENT_IGNORE TRUE #define LOQUI_GENERAL_PREF_DEFAULT_MESSAGES_AWAY_MESSAGE "Gone." #define LOQUI_GENERAL_PREF_DEFAULT_NOTIFICATION_EXEC_NOTIFICATION_BY_NOTICE FALSE #define LOQUI_GENERAL_PREF_DEFAULT_NOTIFICATION_USE_NOTIFICATION TRUE #define LOQUI_GENERAL_PREF_DEFAULT_PROXY_TREAT_AS_RECENT_LOG_UNTIL_FIRST_PONG_RECEIVED FALSE #define LOQUI_GENERAL_PREF_DEFAULT_PROXY_PARSE_PLUM_RECENT FALSE #define LOQUI_GENERAL_PREF_DEFAULT_PROXY_RECENT_LOG_REGEXP "^(?P