merge diff from trunk
This commit is contained in:
parent
f3f622769c
commit
a645006bf8
4
AUTHORS
4
AUTHORS
|
@ -1,8 +1,10 @@
|
|||
CURRENT DEVELOPERS:
|
||||
|
||||
Yann Le Boulanger (asterix AT lagaule.org)
|
||||
Yann Leboulanger (asterix AT lagaule.org)
|
||||
Nikos Kouremenos (kourem AT gmail.com)
|
||||
Travis Shirk (travis AT pobox.com)
|
||||
Stephan Erb (steve-e AT h3c.de)
|
||||
Julien Pivotto (roidelapluie AT gmail.com)
|
||||
|
||||
PAST DEVELOPERS:
|
||||
|
||||
|
|
832
COPYING
832
COPYING
|
@ -1,281 +1,622 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
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
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. 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.
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
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.
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
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.
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. 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.
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
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.
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
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.
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
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".
|
||||
0. Definitions.
|
||||
|
||||
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.
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
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.
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
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.
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
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:
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
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.
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
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.)
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
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.
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
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.
|
||||
1. Source Code.
|
||||
|
||||
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.
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
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 "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
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,
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
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,
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
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 Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
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.
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
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.
|
||||
2. Basic Permissions.
|
||||
|
||||
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.
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
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.
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
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
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
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
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
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.
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
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.
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
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.
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
14. Revised Versions 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
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU 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.
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public 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.
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
NO WARRANTY
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
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.
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
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.
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
|
@ -287,15 +628,15 @@ 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
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
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
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
|
@ -304,37 +645,30 @@ the "copyright" line and a pointer to where the full notice is found.
|
|||
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
|
||||
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
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:
|
||||
If the program does terminal interaction, 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'.
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program 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.
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
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:
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 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.
|
||||
The GNU 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 Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
|
|
29
ChangeLog
29
ChangeLog
|
@ -1,3 +1,32 @@
|
|||
Gajim 0.11.4 (06 December 2007)
|
||||
|
||||
* Fix /nick command in groupchats
|
||||
* Better Metacontacts sorting
|
||||
* Fix Ctrl + PageUP/Down behaviour
|
||||
* Fix saving files from filetransfer under windows
|
||||
|
||||
Gajim 0.11.3 (17 November 2007)
|
||||
|
||||
* Fix bookmarks support detection
|
||||
* Improve file transfer on windows
|
||||
* Fix some zeroconf bugs
|
||||
* Fix focus bug in chat window
|
||||
* Fix nickname changement behaviour in groupchats
|
||||
|
||||
Gajim 0.11.2 (22 September 2007)
|
||||
|
||||
* Improve idle, transports support
|
||||
* Enable ellipsization in roster and chatwindow
|
||||
* Fixed some metacontacts problems (#2156, #2761)
|
||||
* Beter support of XEP-0070 (Verifying HTTP Requests via XMPP)
|
||||
* Make the same height of a banner for all chat tabs
|
||||
* Fix a bug with french translation and invitations (#3043)
|
||||
* Fix a bug with UTF-8 and emoticons
|
||||
* Corrected many bugs with passwords and gnome-keyring
|
||||
* Improve xhtml-im and pictures support
|
||||
* Improve Ad-Hoc support
|
||||
* And many other bufixes
|
||||
|
||||
Gajim 0.11.1 (18 February 2007)
|
||||
* Fixes in gajim-remote and the way XMPP URI are handled
|
||||
* Fix Idle under Windows
|
||||
|
|
12
Makefile.am
12
Makefile.am
|
@ -48,6 +48,16 @@ MAINTAINERCLEANFILES = \
|
|||
compile \
|
||||
depcomp \
|
||||
config.guess \
|
||||
config.log \
|
||||
config.sub \
|
||||
config.status \
|
||||
aclocal.m4 \
|
||||
libtool
|
||||
libtool \
|
||||
po/POTFILES.in \
|
||||
src/trayicon_la-eggtrayicon.loT \
|
||||
m4/intltool.m4
|
||||
|
||||
MAINTAINERCLEANDIRS = \
|
||||
autom4te.cache \
|
||||
build \
|
||||
dist
|
||||
|
|
|
@ -16,7 +16,7 @@ Welcome to Gajim and thank you for trying out our client.
|
|||
<h2>Runtime Requirements</h2>
|
||||
<ul>
|
||||
<li>python2.4 or higher</li>
|
||||
<li>pygtk2.6 or higher</li>
|
||||
<li>pygtk2.8 or higher</li>
|
||||
<li>python-libglade</li>
|
||||
<li>pysqlite2 (if you have python 2.5, you already have this)</li>
|
||||
</ul>
|
||||
|
@ -29,6 +29,7 @@ Gajim is a GTK+ app that loves GNOME. You can do 'make' so you don't require gno
|
|||
<h2>Optional Runtime Requirements</h2>
|
||||
<ul>
|
||||
<li><a href="http://pyopenssl.sourceforge.net/">PyOpenSSL</a> (python-pyopenssl package in Debian) for <em>secure</em> SSL/TLS. Python's default SSL is insecure, so this package is highly recommended!</li>
|
||||
<li>python-crypto to enable End to end encryption</li>
|
||||
<li>For zeroconf (bonjour), the "enable link-local messaging" checkbox, you need dbus-glib, python-avahi</li>
|
||||
<li>dnsutils (or whatever package provides the nslookup binary) for SRV support; if you don't know what that is, you don't need it</li>
|
||||
<li>gtkspell and aspell-LANG where lang is your locale eg. en, fr etc</li>
|
||||
|
@ -37,6 +38,7 @@ Gajim is a GTK+ app that loves GNOME. You can do 'make' so you don't require gno
|
|||
<li>notification-daemon or notify-python (and D-Bus) to get cooler popups</li>
|
||||
<li>D-Bus running to have gajim-remote working</li>
|
||||
<li>python-dbus bindings</li>
|
||||
<li>python-sexy to have clickable URLs in chat windows</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
|
|
|
@ -0,0 +1,99 @@
|
|||
Introduction
|
||||
------------
|
||||
|
||||
This is an alpha release of Gajim for OS/X using native GTK+. It is not finished
|
||||
nor is it relatively stable. The native port of GTK+ is alpha and not stable
|
||||
yet, though it has proven to be usable for Gajim. Having said that it is usable,
|
||||
basic functionality works. See the TODO file for a list of what is and is not
|
||||
working.
|
||||
|
||||
|
||||
|
||||
Installing
|
||||
----------
|
||||
|
||||
Install the GTK+ framework into your /Library/Frameworks directory. It can be
|
||||
found at http://codepunks.org/misc/gtk/osx.
|
||||
|
||||
Copy the Gajim.app into the /Applications directory or any other directory.
|
||||
|
||||
|
||||
Installing language dictionaries
|
||||
--------------------------------
|
||||
|
||||
The codepunks.org build of the GTK+ framework comes with the US English
|
||||
dictionary pre-installed. If you wish to install a different dictionary download
|
||||
the appropriate dictionary from here:
|
||||
|
||||
http://ftp.gnu.org/gnu/aspell/dict/
|
||||
|
||||
Then follow these instructions:
|
||||
|
||||
source /Library/Frameworks/GTK+.framework/Versions/Current/bin/env
|
||||
tar -jxf aspell-<lang>-<version>.tbz2
|
||||
cd aspell-<lang>-<version>
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
|
||||
|
||||
Compiling Requirements
|
||||
----------------------
|
||||
These instructions were gathered for building a universal binary on a PPC. The
|
||||
steps for building on an i386 should be essentially the same.
|
||||
|
||||
Requirements:
|
||||
- OS/X 10.4, i386 or ppc
|
||||
- Universal MacPython 2.5
|
||||
http://www.pythonmac.org/packages/py25-fat/index.html
|
||||
- Latest XCode (2.4.0 or greater)
|
||||
- py2app
|
||||
http://svn.pythonmac.org/py2app/py2app/trunk/doc/index.html
|
||||
|
||||
Install all of the requirements. Make sure that the universal MacPython is
|
||||
installed before py2app. Then ensure that this is the first python in your
|
||||
PATH.
|
||||
|
||||
export PATH=/Library/Frameworks/Python.framework/Versions/2.5/bin:$PATH
|
||||
|
||||
Then install py2app.
|
||||
|
||||
|
||||
Compiling
|
||||
---------
|
||||
|
||||
In the top level run the configure script. If this is source is from subversion
|
||||
then run the autogen.sh script. Follow it up with a make:
|
||||
|
||||
./configure
|
||||
or
|
||||
./autogen.sh
|
||||
make
|
||||
|
||||
Once that is done Gajim can be run from the source tree. You may also create an
|
||||
app bundle suitable for use or distribution. To do that run:
|
||||
|
||||
python setup_osx.py build
|
||||
|
||||
The Gajim.app bundle is created in the dist directory. This bundle is ready
|
||||
for use as is. Copy it to your /Applications directory and you're good to go.
|
||||
|
||||
You now have a self contained (almost, requires GTK+.framework still) universal
|
||||
native build of Gajim.
|
||||
|
||||
Optionally to create a distribution of the Gajim app bundle do:
|
||||
|
||||
python setup_osx.py dist
|
||||
|
||||
|
||||
|
||||
Development
|
||||
-----------
|
||||
|
||||
It is possible to run Gajim correctly from the app bundle but still use the
|
||||
python code in the source tree. This line must be added to the _run() function
|
||||
in the Gajim.app/Resources/__boot__.py file. It needs to be located just after
|
||||
the sys module is imported. Font forget to fix the path to match your
|
||||
environment.
|
||||
|
||||
sys.path = ["/Users/user/Source/gajim/src"] + sys.path
|
1
THANKS
1
THANKS
|
@ -20,7 +20,6 @@ Guillaume Morin
|
|||
Gustavo J. A. M. Carneiro
|
||||
Ivo Anjo
|
||||
Josef Vybíral
|
||||
Julien Pivotto
|
||||
Juraj Michalek
|
||||
Luis Peralta
|
||||
Michael Scherer
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
The bits that work
|
||||
------------------
|
||||
|
||||
-idle checking
|
||||
-dbus and gajim-remote, using dbus from GTK+.framework.
|
||||
-systray icon
|
||||
-app bundle with universal binaries. Depends on the GTK+.framework.
|
||||
-notifications through growl, internal fallback works fine as well
|
||||
-spell checking
|
||||
-running apps and opening files/urls
|
||||
-playing sounds
|
||||
-Network monitoring
|
||||
-Mostly everything else except for whats below.
|
||||
|
||||
|
||||
|
||||
The bits that dont work
|
||||
-----------------------
|
||||
|
||||
-Application start/stop/doc/DnD handling
|
||||
-finish the .app bundle
|
||||
- setup gajim-remote, maybe install it to /usr/local
|
||||
- fix user session management
|
||||
-integrate the Gajim and gajim-remote scripts with autoconf and add GTK
|
||||
framework detection
|
||||
-Maybe setup the pasteboard services for an OS/X alternative to the
|
||||
gajim_remote
|
||||
-CFBundleDocumentTypes.NSDocument
|
||||
-zeroconf has a parsing problem with the MDNS result.
|
||||
|
||||
|
||||
Native GTK bugs
|
||||
----------------
|
||||
|
||||
-cut and paste blows up Finder and the os/x GUI server. very very nasty.
|
||||
-with mutiple displays, popup menus show up on the wrong display
|
14
autogen.sh
14
autogen.sh
|
@ -1,4 +1,12 @@
|
|||
#!/usr/bin/env bash
|
||||
AM_ARGS="--add-missing --gnu --copy"
|
||||
CONF_ARGS=""
|
||||
if test x`uname -s 2>/dev/null` = 'xDarwin';then
|
||||
. /Library/Frameworks/GTK+.framework/Versions/Current/env
|
||||
AM_ARGS="${AM_ARGS} --ignore-deps"
|
||||
CONF_ARGS="${CONF_ARGS} --disable-idle --without-x"
|
||||
fi
|
||||
|
||||
echo "[encoding: UTF-8]" > po/POTFILES.in \
|
||||
&& ls -1 -U data/gajim.desktop.in.in data/glade/*.glade \
|
||||
src/*py src/common/*py src/common/zeroconf/*.py >> \
|
||||
|
@ -8,11 +16,11 @@
|
|||
echo "See README.html for build requirements."
|
||||
exit 1
|
||||
fi
|
||||
set -x
|
||||
|
||||
intltoolize --force --automake \
|
||||
&& aclocal -I ./m4 \
|
||||
&& libtoolize --copy --force --automake \
|
||||
&& autoheader \
|
||||
&& autoconf \
|
||||
&& automake --add-missing --gnu --copy \
|
||||
&& ./configure $@
|
||||
&& automake ${AM_ARGS} \
|
||||
&& ./configure ${CONF_ARGS} $@
|
||||
|
|
81
configure.ac
81
configure.ac
|
@ -1,11 +1,14 @@
|
|||
AC_INIT([Gajim - A Jabber Instant Messager],
|
||||
[0.11.1.5],[http://trac.gajim.org/],[gajim])
|
||||
[0.11.4.0-svn],[http://trac.gajim.org/],[gajim])
|
||||
AC_PREREQ([2.59])
|
||||
AM_INIT_AUTOMAKE([1.8])
|
||||
AC_CONFIG_HEADER(config.h)
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
dnl Make Objective-C work with automake
|
||||
AM_CONDITIONAL([am__fastdepOBJC], false)
|
||||
|
||||
IT_PROG_INTLTOOL([0.35.0])
|
||||
PKG_PROG_PKG_CONFIG([0.19])
|
||||
|
||||
|
@ -33,7 +36,7 @@ AM_NLS
|
|||
dnl ****
|
||||
dnl pygtk and gtk+
|
||||
dnl ****
|
||||
PKG_CHECK_MODULES([PYGTK], [gtk+-2.0 >= 2.6.0 pygtk-2.0 >= 2.6.0])
|
||||
PKG_CHECK_MODULES([PYGTK], [gtk+-2.0 >= 2.8.0 pygtk-2.0 >= 2.8.0])
|
||||
AC_SUBST(PYGTK_CFLAGS)
|
||||
AC_SUBST(PYGTK_LIBS)
|
||||
PYGTK_DEFS=`$PKG_CONFIG --variable=defsdir pygtk-2.0`
|
||||
|
@ -128,6 +131,75 @@ AC_ARG_ENABLE(trayicon,
|
|||
test "x$enable_trayicon" = "xyes" && have_trayicon=true || have_trayicon=false
|
||||
AM_CONDITIONAL(BUILD_TRAYICON, $have_trayicon)
|
||||
|
||||
dnl ****
|
||||
dnl Cocoa
|
||||
dnl ****
|
||||
AC_ARG_ENABLE([cocoa],
|
||||
[ --disable-cocoa build cocoa integration [default auto]],
|
||||
enable_cocoa=$enableval, enable_cocoa=yes)
|
||||
|
||||
if test "x$enable_cocoa" = "xyes";then
|
||||
dnl There is no pkgconfig for cocoa; lets do a header check
|
||||
temp_save_cflags="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -ObjC"
|
||||
AC_CHECK_HEADER(Cocoa/Cocoa.h, [have_cocoa=true], [have_cocoa=false])
|
||||
AC_CHECK_HEADER(AppKit/AppKit.h, [have_appkit=true], [have_appkit=false])
|
||||
CFLAGS="$temp_save_cflags"
|
||||
|
||||
if test "x$have_cocoa" = "xtrue";then
|
||||
COCOA_LIBS="$COCOA_LIBS -Xlinker -framework -Xlinker Cocoa"
|
||||
fi
|
||||
if test "x$have_appkit" = "xtrue";then
|
||||
COCOA_LIBS="$COCOA_LIBS -Xlinker -framework -Xlinker AppKit"
|
||||
fi
|
||||
if test "x$COCOA_LIBS" != "x";then
|
||||
AC_SUBST(COCOA_LIBS)
|
||||
true
|
||||
fi
|
||||
fi
|
||||
AM_CONDITIONAL(BUILD_COCOA, $have_cocoa)
|
||||
|
||||
dnl ****
|
||||
dnl Carbon
|
||||
dnl ****
|
||||
AC_ARG_ENABLE([carbon],
|
||||
[ --disable-carbon build with carbon [default auto]],
|
||||
enable_carbon=$enableval, enable_carbon=yes)
|
||||
|
||||
if test "x$enable_carbon" = "xyes";then
|
||||
dnl There is no pkgconfig for carbon; lets do a header check
|
||||
AC_CHECK_HEADER(Carbon/Carbon.h, [have_carbon=true], [have_carbon=false])
|
||||
AC_CHECK_HEADER(IOKit/IOKitLib.h, [have_iokit=true], [have_iokit=false])
|
||||
|
||||
if test "x$have_carbon" = "xtrue";then
|
||||
CARBON_LIBS="$CARBON_LIBS -Xlinker -framework -Xlinker Carbon"
|
||||
fi
|
||||
if test "x$have_iokit" = "xtrue";then
|
||||
CARBON_LIBS="$CARBON_LIBS -Xlinker -framework -Xlinker IOKit"
|
||||
fi
|
||||
if test "x$CARBON_LIBS" != "x";then
|
||||
AC_SUBST(CARBON_LIBS)
|
||||
have_idle_osx=true
|
||||
dnl Disable X11 idle
|
||||
have_idle=false
|
||||
AM_CONDITIONAL(BUILD_IDLE, false)
|
||||
dnl Disable custom trayicon
|
||||
have_trayicon=gtk+
|
||||
AM_CONDITIONAL(BUILD_TRAYICON, false)
|
||||
dnl Hack to work around failure in gettext package detection on OS/X
|
||||
if test "x$GMSGFMT" = "x";then
|
||||
AC_SUBST(GMSGFMT, msgfmt)
|
||||
AC_SUBST(MSGFMT, msgfmt)
|
||||
AC_SUBST(XGETTEXT, xgettext)
|
||||
fi
|
||||
else
|
||||
have_carbon=false
|
||||
have_idle_osx=false
|
||||
fi
|
||||
fi
|
||||
AM_CONDITIONAL(BUILD_IDLE_OSX, $have_carbon)
|
||||
AM_CONDITIONAL(BUILD_CARBON, $have_carbon)
|
||||
|
||||
ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
|
||||
AC_SUBST(ACLOCAL_AMFLAGS)
|
||||
|
||||
|
@ -159,6 +231,9 @@ AC_CONFIG_FILES([
|
|||
data/defs.py
|
||||
src/Makefile
|
||||
src/common/Makefile
|
||||
src/osx/Makefile
|
||||
src/osx/growl/Makefile
|
||||
src/osx/syncmenu/Makefile
|
||||
scripts/gajim
|
||||
scripts/gajim-remote
|
||||
po/Makefile.in
|
||||
|
@ -171,4 +246,6 @@ echo "
|
|||
idle module ...... ${have_idle}
|
||||
remote control ... ${have_remote}
|
||||
trayicon ......... ${have_trayicon}
|
||||
idle module OSX .. ${have_idle_osx}
|
||||
cocoa ............ ${have_cocoa}
|
||||
*****************************"
|
||||
|
|
|
@ -12,7 +12,7 @@ soundsdir = $(pkgdatadir)/data/sounds
|
|||
sounds_DATA = $(srcdir)/sounds/*.wav
|
||||
|
||||
otherdir = $(pkgdatadir)/data/other
|
||||
other_DATA = other/servers.xml
|
||||
other_DATA = other/servers.xml other/cacerts.pem
|
||||
|
||||
man_MANS = gajim.1 gajim-remote.1
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# coding=utf-8
|
||||
emoticons = {
|
||||
':-[': 'bat.gif',
|
||||
':[': 'bat.gif',
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# coding=utf-8
|
||||
emoticons = {
|
||||
':-)': 'smile.png',
|
||||
':)': 'smile.png',
|
||||
|
@ -54,6 +55,9 @@ emoticons = {
|
|||
#
|
||||
':-[': 'bat.png',
|
||||
':[': 'bat.png',
|
||||
#
|
||||
'>:3': 'lion.png',
|
||||
':3': 'lion.png',
|
||||
#
|
||||
#MSN ones
|
||||
'(@)': 'pussy.png',
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
|
@ -1,3 +1,4 @@
|
|||
# coding=utf-8
|
||||
emoticons = {
|
||||
':-)': 'smile.png',
|
||||
':)': 'smile.png',
|
||||
|
@ -54,6 +55,9 @@ emoticons = {
|
|||
#
|
||||
':-[': 'bat.png',
|
||||
':[': 'bat.png',
|
||||
#
|
||||
'>:3': 'lion.png',
|
||||
':3': 'lion.png',
|
||||
#
|
||||
#MSN ones
|
||||
'(@)': 'pussy.png',
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 934 B |
|
@ -1,7 +1,7 @@
|
|||
.\" 20050818
|
||||
.TH "Gajim-remote" "1" "August 18, 2005" "Gajim dev team" ""
|
||||
.SH "NAME"
|
||||
Gajim-remote
|
||||
Gajim-remote \- tool to communicate with a running instance of Gajim
|
||||
.SH "SYNOPSIS"
|
||||
.B gajim-remote [help] [toggle_roster_appearance] [show_next_unread] [list_contacts] [list_accounts] [change_status] [open_chat] [send_message] [send_file] [contact_info] [account_info] [send_file] [prefs_list] [prefs_put] [prefs_del] [prefs_store] [remove_contact] [add_contact] [get_status] [get_status_message] [get_unread_msgs_number] [start_chat]
|
||||
.SH "DESCRIPTION"
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
[Desktop Entry]
|
||||
Categories=Network;InstantMessaging;Application;GTK;GNOME;
|
||||
Categories=Network;InstantMessaging;GTK;GNOME;
|
||||
_Name=Gajim Instant Messenger
|
||||
_GenericName=Jabber IM Client
|
||||
_Comment=A GTK+ Jabber client
|
||||
Version=@VERSION@
|
||||
Encoding=UTF-8
|
||||
Version=1.0
|
||||
Exec=gajim
|
||||
Icon=gajim.png
|
||||
Icon=gajim
|
||||
StartupNotify=true
|
||||
StartupWMClass=Gajim
|
||||
Terminal=false
|
||||
|
|
|
@ -32,21 +32,31 @@
|
|||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkSeparatorMenuItem" id="seperator">
|
||||
<widget class="GtkSeparatorMenuItem" id="separatormenuitem1">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="open_gmail_inbox_menuitem">
|
||||
<widget class="GtkImageMenuItem" id="start_chat_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Open Gmail Inbox</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes">_Start Chat...</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="menu-item-image7">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="stock">gtk-jump-to</property>
|
||||
<property name="icon_size">1</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="join_group_chat_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Group Chat</property>
|
||||
<property name="label" translatable="yes">Join _Group Chat...</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1236">
|
||||
|
@ -57,6 +67,25 @@
|
|||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkSeparatorMenuItem" id="seperator">
|
||||
<property name="visible">True</property>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="add_contact_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Add Contact...</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1238">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-add</property>
|
||||
<property name="icon_size">1</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="service_discovery_menuitem">
|
||||
<property name="visible">True</property>
|
||||
|
@ -74,7 +103,7 @@
|
|||
<child>
|
||||
<widget class="GtkImageMenuItem" id="execute_command_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Execute Command</property>
|
||||
<property name="label" translatable="yes">_Execute Command...</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1246">
|
||||
|
@ -85,29 +114,22 @@
|
|||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="open_gmail_inbox_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Open Gmail Inbox</property>
|
||||
<property name="use_underline">True</property>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkSeparatorMenuItem" id="seperator">
|
||||
<property name="visible">True</property>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="add_contact_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Add Contact</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1238">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-add</property>
|
||||
<property name="icon_size">1</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="edit_account_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Modify Account...</property>
|
||||
<property name="label" translatable="yes">_Modify Account</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1240">
|
||||
|
|
|
@ -35,7 +35,6 @@ to the Jabber network.</property>
|
|||
<child>
|
||||
<widget class="GtkFrame" id="frame33">
|
||||
<property name="visible">True</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<property name="shadow_type">GTK_SHADOW_NONE</property>
|
||||
<child>
|
||||
<widget class="GtkAlignment" id="alignment68">
|
||||
|
@ -51,7 +50,7 @@ to the Jabber network.</property>
|
|||
<widget class="GtkRadioButton" id="use_existing_account_radiobutton">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">I already have an account I want to use</property>
|
||||
<property name="label" translatable="yes">I already have an account I want to _use</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="response_id">0</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
|
@ -99,9 +98,6 @@ to the Jabber network.</property>
|
|||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="tab_expand">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label259">
|
||||
|
@ -109,7 +105,6 @@ to the Jabber network.</property>
|
|||
</widget>
|
||||
<packing>
|
||||
<property name="type">tab</property>
|
||||
<property name="tab_expand">False</property>
|
||||
<property name="tab_fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
@ -294,7 +289,6 @@ to the Jabber network.</property>
|
|||
</widget>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
<property name="tab_expand">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
|
@ -304,7 +298,6 @@ to the Jabber network.</property>
|
|||
<packing>
|
||||
<property name="type">tab</property>
|
||||
<property name="position">1</property>
|
||||
<property name="tab_expand">False</property>
|
||||
<property name="tab_fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
@ -526,7 +519,6 @@ to the Jabber network.</property>
|
|||
</widget>
|
||||
<packing>
|
||||
<property name="position">2</property>
|
||||
<property name="tab_expand">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
|
@ -536,7 +528,69 @@ to the Jabber network.</property>
|
|||
<packing>
|
||||
<property name="type">tab</property>
|
||||
<property name="position">2</property>
|
||||
<property name="tab_expand">False</property>
|
||||
<property name="tab_fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkVBox" id="ssl_vbox">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<child>
|
||||
<widget class="GtkImage" id="image1">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="stock">gtk-dialog-warning</property>
|
||||
<property name="icon_size">5</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="ssl_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="ssl_checkbutton">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes">Add this certificate to the list of trusted certificates.
|
||||
SHA1 fingerprint of the certificate:
|
||||
</property>
|
||||
<property name="response_id">0</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label482">
|
||||
<property name="visible">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="type">tab</property>
|
||||
<property name="position">3</property>
|
||||
<property name="tab_fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
@ -548,8 +602,7 @@ to the Jabber network.</property>
|
|||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="position">3</property>
|
||||
<property name="tab_expand">False</property>
|
||||
<property name="position">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
|
@ -558,8 +611,7 @@ to the Jabber network.</property>
|
|||
</widget>
|
||||
<packing>
|
||||
<property name="type">tab</property>
|
||||
<property name="position">3</property>
|
||||
<property name="tab_expand">False</property>
|
||||
<property name="position">4</property>
|
||||
<property name="tab_fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
@ -592,8 +644,7 @@ Please wait...</property>
|
|||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="position">4</property>
|
||||
<property name="tab_expand">False</property>
|
||||
<property name="position">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
|
@ -602,8 +653,7 @@ Please wait...</property>
|
|||
</widget>
|
||||
<packing>
|
||||
<property name="type">tab</property>
|
||||
<property name="position">4</property>
|
||||
<property name="tab_expand">False</property>
|
||||
<property name="position">5</property>
|
||||
<property name="tab_fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
@ -671,8 +721,7 @@ Please wait...</property>
|
|||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="position">5</property>
|
||||
<property name="tab_expand">False</property>
|
||||
<property name="position">6</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
|
@ -681,8 +730,7 @@ Please wait...</property>
|
|||
</widget>
|
||||
<packing>
|
||||
<property name="type">tab</property>
|
||||
<property name="position">5</property>
|
||||
<property name="tab_expand">False</property>
|
||||
<property name="position">6</property>
|
||||
<property name="tab_fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
|
|
@ -780,44 +780,21 @@
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox4">
|
||||
<property name="visible">True</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="gpg_save_password_checkbutton1">
|
||||
<widget class="GtkCheckButton" id="use_gpg_agent_checkbutton1">
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="tooltip" translatable="yes">If checked, Gajim will store the password in ~/.gajim/config with 'read' permission only for you</property>
|
||||
<property name="label" translatable="yes">Save _passphrase (insecure)</property>
|
||||
<property name="tooltip" translatable="yes">If checked, Gajim will get the password from a GPG agent like seahorse</property>
|
||||
<property name="label" translatable="yes">Use GPG _Agent</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<signal name="toggled" handler="on_gpg_save_password_checkbutton_toggled"/>
|
||||
<signal name="toggled" handler="on_use_gpg_agent_checkbutton_toggled"/>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkEntry" id="gpg_password_entry1">
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="visibility">False</property>
|
||||
<property name="invisible_char">*</property>
|
||||
<signal name="changed" handler="on_gpg_password_entry_changed"/>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
@ -1218,42 +1195,20 @@ You might consider to change possible firewall settings.</property>
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox7">
|
||||
<property name="visible">True</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="gpg_save_password_checkbutton2">
|
||||
<widget class="GtkCheckButton" id="use_gpg_agent_checkbutton2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="tooltip" translatable="yes">If checked, Gajim will store the password in ~/.gajim/config with 'read' permission only for you</property>
|
||||
<property name="label" translatable="yes">Save _passphrase (insecure)</property>
|
||||
<property name="tooltip" translatable="yes">If checked, Gajim will get the password from a GPG agent like seahorse</property>
|
||||
<property name="label" translatable="yes">Use GPG _Agent</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<signal name="toggled" handler="on_gpg_save_password_checkbutton_toggled"/>
|
||||
<signal name="toggled" handler="on_use_gpg_agent_checkbutton_toggled"/>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkEntry" id="gpg_password_entry2">
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="visibility">False</property>
|
||||
<property name="invisible_char">*</property>
|
||||
<signal name="changed" handler="on_gpg_password_entry_changed"/>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="right_attach">2</property>
|
||||
|
|
|
@ -206,6 +206,7 @@
|
|||
<widget class="GtkCheckButton" id="auto_authorize_checkbutton">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<property name="label" translatable="yes">A_llow this contact to view my status</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="response_id">0</property>
|
||||
|
|
|
@ -1,134 +1,73 @@
|
|||
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
|
||||
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
|
||||
<!--*- mode: xml -*-->
|
||||
<glade-interface>
|
||||
|
||||
<widget class="GtkMenu" id="advanced_menuitem_menu">
|
||||
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="send_single_message_menuitem">
|
||||
<property name="label" translatable="yes">_Send Single Message</property>
|
||||
<property name="use_underline">True</property>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1466">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-new</property>
|
||||
<property name="icon_size">1</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<widget class="GtkMenu" id="advanced_menuitem_menu">
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="xml_console_menuitem">
|
||||
<property name="label" translatable="yes">Show _XML Console</property>
|
||||
<property name="use_underline">True</property>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="blocked_contacts_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Blocked Contacts</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="on_blocked_contacts_menuitem_activate" last_modification_time="Thu, 19 Apr 2007 15:32:47 GMT"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1467">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-stop</property>
|
||||
<property name="icon_size">1</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="privacy_lists_menuitem">
|
||||
<property name="label" translatable="yes">_Privacy Lists</property>
|
||||
<property name="label" translatable="yes">Edit _Privacy Lists...</property>
|
||||
<property name="use_underline">True</property>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkSeparatorMenuItem" id="separator8">
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="administrator_menuitem">
|
||||
<property name="label" translatable="yes">_Administrator</property>
|
||||
<property name="use_underline">True</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenu" id="administrator_menuitem_menu">
|
||||
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="send_server_message_menuitem">
|
||||
<property name="tooltip" translatable="yes">Sends a message to users currently connected to this server</property>
|
||||
<property name="label" translatable="yes">_Send Server Message</property>
|
||||
<property name="label" translatable="yes">_Send Server Message...</property>
|
||||
<property name="use_underline">True</property>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1468">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-new</property>
|
||||
<property name="icon_size">1</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkSeparatorMenuItem" id="separator9">
|
||||
<property name="visible">True</property>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="set_motd_menuitem">
|
||||
<property name="tooltip" translatable="yes">Sets Message of the Day</property>
|
||||
<property name="label" translatable="yes">Set MOTD</property>
|
||||
<property name="label" translatable="yes">Set MOTD...</property>
|
||||
<property name="use_underline">True</property>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="update_motd_menuitem">
|
||||
<property name="tooltip" translatable="yes">Updates Message of the Day</property>
|
||||
<property name="label" translatable="yes">Update MOTD</property>
|
||||
<property name="label" translatable="yes">Update MOTD...</property>
|
||||
<property name="use_underline">True</property>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="delete_motd_menuitem">
|
||||
<property name="tooltip" translatable="yes">Deletes Message of the Day</property>
|
||||
<property name="label" translatable="yes">Delete MOTD</property>
|
||||
<property name="use_underline">True</property>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1469">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-clear</property>
|
||||
<property name="icon_size">1</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
@ -137,6 +76,5 @@
|
|||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
</widget>
|
||||
</glade-interface>
|
||||
|
|
|
@ -135,7 +135,7 @@
|
|||
<child>
|
||||
<widget class="GtkImageMenuItem" id="add_to_roster_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Add to Roster</property>
|
||||
<property name="label" translatable="yes">_Add to Roster...</property>
|
||||
<property name="use_underline">True</property>
|
||||
|
||||
<child internal-child="image">
|
||||
|
|
|
@ -1,90 +1,104 @@
|
|||
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
|
||||
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
|
||||
<!--*- mode: xml -*-->
|
||||
<glade-interface>
|
||||
|
||||
<widget class="GtkMenu" id="chat_control_popup_menu">
|
||||
|
||||
<widget class="GtkMenu" id="chat_control_popup_menu">
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="add_to_roster_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Add to Roster</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="_on_add_to_roster_menuitem_activate"/>
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1372">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-add</property>
|
||||
<property name="icon_size">1</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="send_file_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Send _File</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="_on_send_file_menuitem_activate"/>
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1371">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-save</property>
|
||||
<property name="icon_size">1</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="convert_to_groupchat">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes">Invite _Contacts</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="menu-item-image4">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="stock">gtk-missing-image</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkSeparatorMenuItem" id="separatormenuitem2">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkCheckMenuItem" id="toggle_gpg_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Toggle Open_PGP Encryption</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="_on_toggle_gpg_menuitem_activate"/>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkCheckMenuItem" id="toggle_e2e_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes">Toggle End to End Encryption</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="_on_toggle_e2e_menuitem_activate"/>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkSeparatorMenuItem" id="separatormenuitem1">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="information_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="label">gtk-info</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="use_stock">True</property>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="history_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="tooltip" translatable="yes">Click to see past conversations with this contact</property>
|
||||
<property name="label" translatable="yes">_History</property>
|
||||
<property name="use_underline">True</property>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1370">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-justify-fill</property>
|
||||
<property name="icon_size">1</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="information_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="label">gtk-info</property>
|
||||
<property name="use_stock">True</property>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="send_file_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Send _File</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="_on_send_file_menuitem_activate" last_modification_time="Tue, 03 Jan 2006 04:26:55 GMT"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1371">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-file</property>
|
||||
<property name="icon_size">1</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckMenuItem" id="toggle_gpg_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Toggle Open_PGP Encryption</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="active">False</property>
|
||||
<signal name="activate" handler="_on_toggle_gpg_menuitem_activate" last_modification_time="Tue, 03 Jan 2006 04:26:46 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="add_to_roster_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Add to Roster</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="_on_add_to_roster_menuitem_activate" last_modification_time="Tue, 03 Jan 2006 04:26:37 GMT"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1372">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-add</property>
|
||||
<property name="icon_size">1</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
</glade-interface>
|
||||
|
|
|
@ -0,0 +1,185 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
|
||||
<!--*- mode: xml -*-->
|
||||
<glade-interface>
|
||||
<widget class="GtkWindow" id="chat_to_muc_window">
|
||||
<property name="visible">True</property>
|
||||
<property name="border_width">5</property>
|
||||
<property name="title" translatable="yes">Invite Friends !</property>
|
||||
<signal name="key_press_event" handler="on_chat_to_muc_window_key_press_event"/>
|
||||
<signal name="destroy" handler="on_chat_to_muc_window_destroy"/>
|
||||
<child>
|
||||
<widget class="GtkVBox" id="general_vbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label3">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes">You are going to begin a Multi-User Chat.
|
||||
Select the contacts you want to invite</property>
|
||||
<property name="justify">GTK_JUSTIFY_CENTER</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="padding">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkScrolledWindow" id="guests_scrolledwindow">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
|
||||
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
|
||||
<property name="shadow_type">GTK_SHADOW_IN</property>
|
||||
<child>
|
||||
<widget class="GtkTreeView" id="guests_treeview">
|
||||
<property name="height_request">300</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="headers_visible">False</property>
|
||||
<signal name="drag_data_get" handler="on_guests_treeview_drag_data_get"/>
|
||||
<signal name="drag_data_received" handler="on_guests_treeview_drag_data_received"/>
|
||||
<signal name="drag_end" handler="on_guests_treeview_drag_end"/>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">4</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkExpander" id="expander1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<child>
|
||||
<widget class="GtkVBox" id="vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="server_select_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Please select a MUC server.</property>
|
||||
<property name="justify">GTK_JUSTIFY_CENTER</property>
|
||||
<property name="wrap">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="padding">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkComboBoxEntry" id="server_list_comboboxentry">
|
||||
<property name="visible">True</property>
|
||||
<child internal-child="entry">
|
||||
<widget class="GtkEntry" id="comboboxentry-entry1">
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label2">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes">MUC server</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="type">label_item</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkHButtonBox" id="hbuttonbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="spacing">6</property>
|
||||
<property name="layout_style">GTK_BUTTONBOX_END</property>
|
||||
<child>
|
||||
<widget class="GtkButton" id="cancel_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label">gtk-cancel</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="response_id">0</property>
|
||||
<signal name="clicked" handler="on_cancel_button_clicked"/>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="padding">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkButton" id="invite_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="response_id">0</property>
|
||||
<signal name="clicked" handler="on_invite_button_clicked"/>
|
||||
<child>
|
||||
<widget class="GtkAlignment" id="alignment1">
|
||||
<property name="visible">True</property>
|
||||
<property name="xscale">0</property>
|
||||
<property name="yscale">0</property>
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox2">
|
||||
<property name="visible">True</property>
|
||||
<property name="spacing">2</property>
|
||||
<child>
|
||||
<widget class="GtkImage" id="image1">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-jump-to</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label1">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">In_vite</property>
|
||||
<property name="use_underline">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="padding">3</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</glade-interface>
|
|
@ -271,7 +271,7 @@
|
|||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1146">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-missing-image</property>
|
||||
<property name="stock">gtk-directory</property>
|
||||
<property name="icon_size">1</property>
|
||||
</widget>
|
||||
</child>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<widget class="GtkMenu" id="gc_control_popup_menu">
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="change_nick_menuitem">
|
||||
<property name="label" translatable="yes">Change _Nickname</property>
|
||||
<property name="label" translatable="yes">Change _Nickname...</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1409">
|
||||
|
@ -28,7 +28,7 @@
|
|||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="change_subject_menuitem">
|
||||
<property name="label" translatable="yes">Change _Subject</property>
|
||||
<property name="label" translatable="yes">Change _Subject...</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1408">
|
||||
|
@ -41,7 +41,7 @@
|
|||
</child>
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="configure_room_menuitem">
|
||||
<property name="label" translatable="yes">Configure _Room</property>
|
||||
<property name="label" translatable="yes">Configure _Room...</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1406">
|
||||
|
|
|
@ -17,6 +17,20 @@
|
|||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="send_file_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes">Send _File</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="menu-item-image4">
|
||||
<property name="stock">gtk-save</property>
|
||||
<property name="icon_size">1</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="group_chat_actions_menuitem">
|
||||
<property name="visible">True</property>
|
||||
|
@ -87,20 +101,6 @@
|
|||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="send_file_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes">Send _File</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="menu-item-image4">
|
||||
<property name="stock">gtk-save</property>
|
||||
<property name="icon_size">1</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkSeparatorMenuItem" id="separator6">
|
||||
<property name="visible">True</property>
|
||||
|
|
|
@ -42,19 +42,92 @@
|
|||
<child>
|
||||
<widget class="GtkVBox" id="vbox1">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<widget class="GtkVBox" id="welcome_vbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="welcome_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes"><big><b>Welcome to Gajim History Logs Manager</b></big>
|
||||
<property name="label" translatable="yes"><big><b>Welcome to Gajim History Logs Manager</b></big></property>
|
||||
<property name="use_markup">True</property>
|
||||
<property name="justify">GTK_JUSTIFY_CENTER</property>
|
||||
<property name="wrap">True</property>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox3">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<child>
|
||||
<widget class="GtkImage" id="image3">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="xalign">1</property>
|
||||
<property name="yalign">0</property>
|
||||
<property name="stock">gtk-info</property>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="info_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes">This log manager is not intended for log viewing. If you are looking for such functionality, use the history window instead.
|
||||
|
||||
You can select logs from the left and/or search database from below.
|
||||
|
||||
<b>WARNING:</b>
|
||||
Use this program to delete or export logs. You can select logs from the left and/or search database from below.</property>
|
||||
<property name="use_markup">True</property>
|
||||
<property name="wrap">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="padding">20</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox2">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<child>
|
||||
<widget class="GtkImage" id="warning_image">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="xalign">1</property>
|
||||
<property name="yalign">0</property>
|
||||
<property name="stock">gtk-dialog-warning</property>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="warning_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes"><b>WARNING:</b>
|
||||
If you plan to do massive deletions, please make sure Gajim is not running. Generally avoid deletions with contacts you currently chat with.</property>
|
||||
<property name="use_markup">True</property>
|
||||
<property name="wrap">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="padding">20</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkScrolledWindow" id="logs_scrolledwindow">
|
||||
|
@ -115,7 +188,6 @@ If you plan to do massive deletions, please make sure Gajim is not running. Gene
|
|||
<widget class="GtkEntry" id="search_entry">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">*</property>
|
||||
<property name="activates_default">True</property>
|
||||
</widget>
|
||||
</child>
|
||||
|
|
|
@ -1,306 +1,53 @@
|
|||
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
|
||||
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
|
||||
<!--*- mode: xml -*-->
|
||||
<glade-interface>
|
||||
|
||||
<widget class="GtkWindow" id="history_window">
|
||||
<widget class="GtkWindow" id="history_window">
|
||||
<property name="title" translatable="yes">Conversation History</property>
|
||||
<property name="type">GTK_WINDOW_TOPLEVEL</property>
|
||||
<property name="window_position">GTK_WIN_POS_NONE</property>
|
||||
<property name="modal">False</property>
|
||||
<property name="role">history</property>
|
||||
<property name="default_width">650</property>
|
||||
<property name="default_height">350</property>
|
||||
<property name="resizable">True</property>
|
||||
<property name="destroy_with_parent">False</property>
|
||||
<property name="role">history</property>
|
||||
<property name="decorated">True</property>
|
||||
<property name="skip_taskbar_hint">False</property>
|
||||
<property name="skip_pager_hint">False</property>
|
||||
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
|
||||
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
|
||||
<property name="focus_on_map">True</property>
|
||||
<signal name="destroy" handler="on_history_window_destroy" last_modification_time="Tue, 01 Mar 2005 16:30:31 GMT"/>
|
||||
|
||||
<signal name="key_press_event" handler="on_history_window_key_press_event"/>
|
||||
<signal name="destroy" handler="on_history_window_destroy"/>
|
||||
<child>
|
||||
<widget class="GtkVBox" id="vbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="border_width">6</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">6</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkHPaned" id="hpaned">
|
||||
<widget class="GtkFrame" id="frame1">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="shadow_type">GTK_SHADOW_NONE</property>
|
||||
<child>
|
||||
<widget class="GtkAlignment" id="alignment1">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="left_padding">12</property>
|
||||
<child>
|
||||
<widget class="GtkVBox" id="vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<child>
|
||||
<widget class="GtkEntry" id="jid_entry">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="position">165</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkVBox" id="vbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">6</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCalendar" id="calendar">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="display_options">GTK_CALENDAR_SHOW_HEADING|GTK_CALENDAR_SHOW_DAY_NAMES</property>
|
||||
<signal name="day_selected" handler="on_calendar_day_selected" last_modification_time="Sun, 20 Nov 2005 19:26:58 GMT"/>
|
||||
<signal name="month_changed" handler="on_calendar_month_changed" last_modification_time="Thu, 24 Nov 2005 00:49:22 GMT"/>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="shrink">True</property>
|
||||
<property name="resize">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkScrolledWindow" id="scrolledwindow">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
|
||||
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
|
||||
<property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
|
||||
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
|
||||
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="shrink">True</property>
|
||||
<property name="resize">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="log_history_checkbutton">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">_Log conversation history</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">True</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkExpander" id="search_expander">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="expanded">False</property>
|
||||
<property name="spacing">0</property>
|
||||
<signal name="activate" handler="on_search_expander_activate" last_modification_time="Tue, 29 Nov 2005 13:43:41 GMT"/>
|
||||
|
||||
<child>
|
||||
<widget class="GtkVBox" id="expander_vbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">6</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkHBox" id="query_hbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">6</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkEntry" id="query_entry">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">True</property>
|
||||
<property name="visibility">True</property>
|
||||
<property name="max_length">0</property>
|
||||
<property name="text" translatable="yes"></property>
|
||||
<property name="has_frame">True</property>
|
||||
<property name="invisible_char">*</property>
|
||||
<property name="activates_default">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkButton" id="search_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="has_default">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<signal name="clicked" handler="on_search_button_clicked" last_modification_time="Tue, 29 Nov 2005 11:40:15 GMT"/>
|
||||
|
||||
<child>
|
||||
<widget class="GtkAlignment" id="alignment99">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xscale">0</property>
|
||||
<property name="yscale">0</property>
|
||||
<property name="top_padding">0</property>
|
||||
<property name="bottom_padding">0</property>
|
||||
<property name="left_padding">0</property>
|
||||
<property name="right_padding">0</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox3004">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">2</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImage" id="image1327">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-find</property>
|
||||
<property name="icon_size">4</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label372">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Search</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="tooltip" translatable="yes">Choose the chatlog you want to view.
|
||||
Enter the jid of a groupchat or a contact here. For online accounts you can even enter a a contact's nickname.</property>
|
||||
<signal name="activate" handler="on_jid_entry_activate"/>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkButton" id="query_builder_button">
|
||||
<widget class="GtkLabel" id="label1">
|
||||
<property name="visible">True</property>
|
||||
<property name="tooltip" translatable="yes">Build custom query</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">Query Builder...</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<signal name="clicked" handler="on_query_builder_button_clicked" last_modification_time="Tue, 29 Nov 2005 11:40:18 GMT"/>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkScrolledWindow" id="results_scrolledwindow">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
|
||||
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
|
||||
<property name="shadow_type">GTK_SHADOW_IN</property>
|
||||
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkTreeView" id="results_treeview">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="headers_visible">True</property>
|
||||
<property name="rules_hint">True</property>
|
||||
<property name="reorderable">False</property>
|
||||
<property name="enable_search">True</property>
|
||||
<property name="fixed_height_mode">False</property>
|
||||
<property name="hover_selection">False</property>
|
||||
<property name="hover_expand">False</property>
|
||||
<signal name="row_activated" handler="on_results_treeview_row_activated" last_modification_time="Tue, 29 Nov 2005 21:05:37 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label368">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Search</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes"><b>JID Selection</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="type">label_item</property>
|
||||
|
@ -308,39 +55,229 @@
|
|||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="padding">8</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkHButtonBox" id="hbuttonbox">
|
||||
<widget class="GtkFrame" id="frame2">
|
||||
<property name="visible">True</property>
|
||||
<property name="layout_style">GTK_BUTTONBOX_END</property>
|
||||
<property name="spacing">6</property>
|
||||
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="shadow_type">GTK_SHADOW_NONE</property>
|
||||
<child>
|
||||
<widget class="GtkButton" id="close_button">
|
||||
<widget class="GtkAlignment" id="alignment2">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="left_padding">12</property>
|
||||
<child>
|
||||
<widget class="GtkHPaned" id="hpaned">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label">gtk-close</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<signal name="clicked" handler="on_close_button_clicked" last_modification_time="Tue, 01 Mar 2005 16:21:16 GMT"/>
|
||||
<property name="position">165</property>
|
||||
<child>
|
||||
<widget class="GtkVBox" id="vbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<widget class="GtkCalendar" id="calendar">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<signal name="month_changed" handler="on_calendar_month_changed"/>
|
||||
<signal name="day_selected" handler="on_calendar_day_selected"/>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="resize">False</property>
|
||||
<property name="shrink">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkScrolledWindow" id="scrolledwindow">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
|
||||
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
|
||||
<property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="resize">True</property>
|
||||
<property name="shrink">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label2">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes"><b>History Viewer</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="type">label_item</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="log_history_checkbutton">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">_Log conversation history</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="response_id">0</property>
|
||||
<property name="active">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkExpander" id="search_expander">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<signal name="activate" handler="on_search_expander_activate"/>
|
||||
<child>
|
||||
<widget class="GtkVBox" id="expander_vbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<widget class="GtkHBox" id="query_hbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label3">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes">Search</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkEntry" id="query_entry">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="activates_default">True</property>
|
||||
<signal name="activate" handler="on_query_entry_activate"/>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label4">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes">in</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkComboBox" id="query_combobox">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="focus_on_click">False</property>
|
||||
<property name="items" translatable="yes">Current History
|
||||
All Chat Histories</property>
|
||||
<signal name="changed" handler="on_query_combobox_changed"/>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="pack_type">GTK_PACK_END</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkScrolledWindow" id="results_scrolledwindow">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
|
||||
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
|
||||
<property name="shadow_type">GTK_SHADOW_IN</property>
|
||||
<child>
|
||||
<widget class="GtkTreeView" id="results_treeview">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="rules_hint">True</property>
|
||||
<signal name="row_activated" handler="on_results_treeview_row_activated"/>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label368">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Search</property>
|
||||
<property name="use_underline">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="type">label_item</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkHButtonBox" id="hbuttonbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="spacing">6</property>
|
||||
<property name="layout_style">GTK_BUTTONBOX_END</property>
|
||||
<child>
|
||||
<widget class="GtkButton" id="close_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="label">gtk-close</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="response_id">0</property>
|
||||
<signal name="clicked" handler="on_close_button_clicked"/>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</glade-interface>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -19,6 +19,7 @@
|
|||
<property name="focus_on_map">True</property>
|
||||
<property name="urgency_hint">False</property>
|
||||
<property name="has_separator">True</property>
|
||||
<signal name="destroy" handler="on_passphrase_dialog_destroy" last_modification_time="Sun, 11 Mar 2007 11:32:38 GMT"/>
|
||||
|
||||
<child internal-child="vbox">
|
||||
<widget class="GtkVBox" id="dialog-vbox4">
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -20,7 +20,7 @@
|
|||
<child>
|
||||
<widget class="GtkImageMenuItem" id="send_single_message_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Send Single _Message</property>
|
||||
<property name="label" translatable="yes">Send Single _Message...</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1703">
|
||||
|
@ -34,12 +34,12 @@
|
|||
<child>
|
||||
<widget class="GtkImageMenuItem" id="send_file_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Send _File</property>
|
||||
<property name="label" translatable="yes">Send _File...</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1706">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-floppy</property>
|
||||
<property name="stock">gtk-save</property>
|
||||
<property name="icon_size">1</property>
|
||||
</widget>
|
||||
</child>
|
||||
|
@ -103,7 +103,7 @@
|
|||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="rename_menuitem">
|
||||
<property name="label" translatable="yes">_Rename</property>
|
||||
<property name="label" translatable="yes">_Rename...</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1705">
|
||||
|
@ -116,7 +116,7 @@
|
|||
</child>
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="edit_groups_menuitem">
|
||||
<property name="label" translatable="yes">Edit _Groups</property>
|
||||
<property name="label" translatable="yes">Edit _Groups...</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="menu-item-image21">
|
||||
|
@ -130,13 +130,13 @@
|
|||
</child>
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="assign_openpgp_key_menuitem">
|
||||
<property name="label" translatable="yes">Assign Open_PGP Key</property>
|
||||
<property name="label" translatable="yes">Assign Open_PGP Key...</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="on_assign_openpgp_key_menuitem_activate"/>
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1707">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-missing-image</property>
|
||||
<property name="stock">gtk-dialog-authentication</property>
|
||||
<property name="icon_size">1</property>
|
||||
</widget>
|
||||
</child>
|
||||
|
@ -146,7 +146,7 @@
|
|||
<widget class="GtkImageMenuItem" id="set_custom_avatar_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes">Set Custom _Avatar</property>
|
||||
<property name="label" translatable="yes">Set Custom _Avatar...</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="menu-item-image20">
|
||||
|
@ -160,9 +160,8 @@
|
|||
</child>
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="add_special_notification_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<property name="label" translatable="yes">Add Special _Notification</property>
|
||||
<property name="label" translatable="yes">Add Special _Notification...</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1708">
|
||||
|
@ -268,6 +267,19 @@
|
|||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="add_to_roster_menuitem">
|
||||
<property name="label" translatable="yes">_Add to Roster...</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1716">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-add</property>
|
||||
<property name="icon_size">1</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="remove_from_roster_menuitem">
|
||||
<property name="label" translatable="yes">_Remove</property>
|
||||
|
@ -281,19 +293,6 @@
|
|||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="add_to_roster_menuitem">
|
||||
<property name="label" translatable="yes">_Add to Roster</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1716">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-add</property>
|
||||
<property name="icon_size">1</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
<child internal-child="image">
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
<child>
|
||||
<widget class="GtkImageMenuItem" id="new_chat_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Start Chat</property>
|
||||
<property name="label" translatable="yes">_Start Chat...</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1605">
|
||||
|
@ -42,10 +42,23 @@
|
|||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="send_single_message_menuitem">
|
||||
<property name="label" translatable="yes">_Send Single Message...</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="menu-item-image5">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-new</property>
|
||||
<property name="icon_size">1</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="join_gc_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Group Chat</property>
|
||||
<property name="label" translatable="yes">Join _Group Chat...</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1606">
|
||||
|
@ -64,7 +77,7 @@
|
|||
<child>
|
||||
<widget class="GtkImageMenuItem" id="add_new_contact_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Add _Contact</property>
|
||||
<property name="label" translatable="yes">Add _Contact...</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1607">
|
||||
|
@ -232,7 +245,24 @@
|
|||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1613">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-missing-image</property>
|
||||
<property name="stock">gtk-save</property>
|
||||
<property name="icon_size">1</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="history_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes">_History</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="on_history_menuitem_activate"/>
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="menu-item-image14">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="stock">gtk-justify-fill</property>
|
||||
<property name="icon_size">1</property>
|
||||
</widget>
|
||||
</child>
|
||||
|
@ -341,6 +371,7 @@
|
|||
<signal name="row_expanded" handler="on_roster_treeview_row_expanded"/>
|
||||
<signal name="key_press_event" handler="on_roster_treeview_key_press_event"/>
|
||||
<signal name="row_activated" handler="on_roster_treeview_row_activated"/>
|
||||
<signal name="button_release_event" handler="on_roster_treeview_button_release_event"/>
|
||||
<signal name="scroll_event" handler="on_roster_treeview_scroll_event"/>
|
||||
<signal name="style_set" handler="on_roster_treeview_style_set"/>
|
||||
</widget>
|
||||
|
|
|
@ -62,16 +62,22 @@ Agent JID - node</property>
|
|||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label224">
|
||||
<widget class="GtkComboBoxEntry" id="address_comboboxentry">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Address:</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">address_comboboxentry</property>
|
||||
<property name="items" translatable="yes"></property>
|
||||
<signal name="changed" handler="on_address_comboboxentry_changed"/>
|
||||
<signal name="key_press_event" handler="on_address_comboboxentry_key_press_event"/>
|
||||
<child internal-child="entry">
|
||||
<widget class="GtkEntry" id="comboboxentry-entry1">
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="y_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
|
@ -127,22 +133,16 @@ Agent JID - node</property>
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkComboBoxEntry" id="address_comboboxentry">
|
||||
<widget class="GtkLabel" id="label224">
|
||||
<property name="visible">True</property>
|
||||
<property name="items" translatable="yes"></property>
|
||||
<signal name="changed" handler="on_address_comboboxentry_changed"/>
|
||||
<signal name="key_press_event" handler="on_address_comboboxentry_key_press_event"/>
|
||||
<child internal-child="entry">
|
||||
<widget class="GtkEntry" id="comboboxentry-entry1">
|
||||
</widget>
|
||||
</child>
|
||||
<property name="label" translatable="yes">_Address:</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">address_comboboxentry</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="y_options">GTK_FILL</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
|
@ -171,41 +171,6 @@ Agent JID - node</property>
|
|||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkHBox" id="filter_hbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label361">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Filter:</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">filter_entry</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkEntry" id="filter_entry">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">*</property>
|
||||
<signal name="changed" handler="on_filter_entry_changed"/>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox2994">
|
||||
<property name="visible">True</property>
|
||||
|
@ -260,7 +225,7 @@ Agent JID - node</property>
|
|||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="padding">2</property>
|
||||
<property name="position">4</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
<property name="default_height">280</property>
|
||||
<signal name="key_press_event" handler="on_single_message_window_key_press_event"/>
|
||||
<signal name="delete_event" handler="on_single_message_window_delete_event"/>
|
||||
<signal name="destroy" handler="on_single_message_window_destroy"/>
|
||||
<child>
|
||||
<widget class="GtkVBox" id="vbox97">
|
||||
<property name="visible">True</property>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<property name="label" translatable="yes">Start _Chat</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1534">
|
||||
<widget class="GtkImage" id="image1701">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-jump-to</property>
|
||||
<property name="icon_size">1</property>
|
||||
|
@ -18,38 +18,56 @@
|
|||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="rename_menuitem">
|
||||
<property name="label" translatable="yes">_Rename</property>
|
||||
<widget class="GtkImageMenuItem" id="send_file_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Send _File</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1535">
|
||||
<widget class="GtkImage" id="image1706">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-refresh</property>
|
||||
<property name="stock">gtk-save</property>
|
||||
<property name="icon_size">1</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="edit_groups_menuitem">
|
||||
<property name="label" translatable="yes">Edit _Groups</property>
|
||||
<property name="use_underline">True</property>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkSeparatorMenuItem" id="above_send_file_separator">
|
||||
<property name="visible">True</property>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="send_file_menuitem">
|
||||
<widget class="GtkImageMenuItem" id="manage_contact">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Send _File</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes">_Manage Contact</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child>
|
||||
<widget class="GtkMenu" id="menu2">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="rename_menuitem">
|
||||
<property name="label" translatable="yes">_Rename</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1536">
|
||||
<widget class="GtkImage" id="image1705">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-missing-image</property>
|
||||
<property name="stock">gtk-refresh</property>
|
||||
<property name="icon_size">1</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="edit_groups_menuitem">
|
||||
<property name="label" translatable="yes">Edit _Groups</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="menu-item-image21">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="stock">gtk-edit</property>
|
||||
<property name="icon_size">1</property>
|
||||
</widget>
|
||||
</child>
|
||||
|
@ -61,9 +79,9 @@
|
|||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="on_assign_openpgp_key_menuitem_activate"/>
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1537">
|
||||
<widget class="GtkImage" id="image1707">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-missing-image</property>
|
||||
<property name="stock">gtk-dialog-authentication</property>
|
||||
<property name="icon_size">1</property>
|
||||
</widget>
|
||||
</child>
|
||||
|
@ -71,12 +89,11 @@
|
|||
</child>
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="add_special_notification_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<property name="label" translatable="yes">Add Special _Notification</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1538">
|
||||
<widget class="GtkImage" id="image1708">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-info</property>
|
||||
<property name="icon_size">1</property>
|
||||
|
@ -84,8 +101,20 @@
|
|||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="menu-item-image19">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="stock">gtk-properties</property>
|
||||
<property name="icon_size">1</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkSeparatorMenuItem" id="above_information_separator">
|
||||
<widget class="GtkSeparatorMenuItem" id="separator6">
|
||||
<property name="visible">True</property>
|
||||
</widget>
|
||||
</child>
|
||||
|
@ -101,7 +130,7 @@
|
|||
<property name="label" translatable="yes">_History</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1539">
|
||||
<widget class="GtkImage" id="image1718">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-justify-fill</property>
|
||||
<property name="icon_size">1</property>
|
||||
|
|
|
@ -1,49 +1,41 @@
|
|||
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
|
||||
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
|
||||
<!--*- mode: xml -*-->
|
||||
<glade-interface>
|
||||
|
||||
<widget class="GtkMenu" id="zeroconf_context_menu">
|
||||
|
||||
<widget class="GtkMenu" id="zeroconf_context_menu">
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="status_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Status</property>
|
||||
<property name="use_underline">True</property>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1258">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-network</property>
|
||||
<property name="icon_size">1</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkSeparatorMenuItem" id="separatormenuitem1">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="zeroconf_properties_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Modify Account...</property>
|
||||
<property name="use_underline">True</property>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1259">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-preferences</property>
|
||||
<property name="icon_size">1</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
</widget>
|
||||
</glade-interface>
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
IBClasses = ({CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; });
|
||||
IBVersion = 1;
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IBDocumentLocation</key>
|
||||
<string>82 255 356 240 0 0 1280 832 </string>
|
||||
<key>IBEditorPositions</key>
|
||||
<dict>
|
||||
<key>29</key>
|
||||
<string>476 296 342 44 0 0 1280 832 </string>
|
||||
</dict>
|
||||
<key>IBFramework Version</key>
|
||||
<string>446.1</string>
|
||||
<key>IBOldestOS</key>
|
||||
<integer>4</integer>
|
||||
<key>IBOpenObjects</key>
|
||||
<array>
|
||||
<integer>289</integer>
|
||||
<integer>29</integer>
|
||||
</array>
|
||||
<key>IBSystem Version</key>
|
||||
<string>8S165</string>
|
||||
</dict>
|
||||
</plist>
|
Binary file not shown.
|
@ -476,7 +476,42 @@ zk6q5PYvCdxTby78dOs6Y5nCpqyJvKeyRKANihDjbPIky/qbn3BHLt4Ui9SyIAmW
|
|||
omTxJBzcoTWcFbLUvFUufQb1nA5V9FrWk9p2rSVzTMVD
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
|
||||
CAcert_org_-_class3_CA
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIGCDCCA/CgAwIBAgIBATANBgkqhkiG9w0BAQQFADB5MRAwDgYDVQQKEwdSb290
|
||||
IENBMR4wHAYDVQQLExVodHRwOi8vd3d3LmNhY2VydC5vcmcxIjAgBgNVBAMTGUNB
|
||||
IENlcnQgU2lnbmluZyBBdXRob3JpdHkxITAfBgkqhkiG9w0BCQEWEnN1cHBvcnRA
|
||||
Y2FjZXJ0Lm9yZzAeFw0wNTEwMTQwNzM2NTVaFw0zMzAzMjgwNzM2NTVaMFQxFDAS
|
||||
BgNVBAoTC0NBY2VydCBJbmMuMR4wHAYDVQQLExVodHRwOi8vd3d3LkNBY2VydC5v
|
||||
cmcxHDAaBgNVBAMTE0NBY2VydCBDbGFzcyAzIFJvb3QwggIiMA0GCSqGSIb3DQEB
|
||||
AQUAA4ICDwAwggIKAoICAQCrSTURSHzSJn5TlM9Dqd0o10Iqi/OHeBlYfA+e2ol9
|
||||
4fvrcpANdKGWZKufoCSZc9riVXbHF3v1BKxGuMO+f2SNEGwk82GcwPKQ+lHm9WkB
|
||||
Y8MPVuJKQs/iRIwlKKjFeQl9RrmK8+nzNCkIReQcn8uUBByBqBSzmGXEQ+xOgo0J
|
||||
0b2qW42S0OzekMV/CsLj6+YxWl50PpczWejDAz1gM7/30W9HxM3uYoNSbi4ImqTZ
|
||||
FRiRpoWSR7CuSOtttyHshRpocjWr//AQXcD0lKdq1TuSfkyQBX6TwSyLpI5idBVx
|
||||
bgtxA+qvFTia1NIFcm+M+SvrWnIl+TlG43IbPgTDZCciECqKT1inA62+tC4T7V2q
|
||||
SNfVfdQqe1z6RgRQ5MwOQluM7dvyz/yWk+DbETZUYjQ4jwxgmzuXVjit89Jbi6Bb
|
||||
6k6WuHzX1aCGcEDTkSm3ojyt9Yy7zxqSiuQ0e8DYbF/pCsLDpyCaWt8sXVJcukfV
|
||||
m+8kKHA4IC/VfynAskEDaJLM4JzMl0tF7zoQCqtwOpiVcK01seqFK6QcgCExqa5g
|
||||
eoAmSAC4AcCTY1UikTxW56/bOiXzjzFU6iaLgVn5odFTEcV7nQP2dBHgbbEsPyyG
|
||||
kZlxmqZ3izRg0RS0LKydr4wQ05/EavhvE/xzWfdmQnQeiuP43NJvmJzLR5iVQAX7
|
||||
6QIDAQABo4G/MIG8MA8GA1UdEwEB/wQFMAMBAf8wXQYIKwYBBQUHAQEEUTBPMCMG
|
||||
CCsGAQUFBzABhhdodHRwOi8vb2NzcC5DQWNlcnQub3JnLzAoBggrBgEFBQcwAoYc
|
||||
aHR0cDovL3d3dy5DQWNlcnQub3JnL2NhLmNydDBKBgNVHSAEQzBBMD8GCCsGAQQB
|
||||
gZBKMDMwMQYIKwYBBQUHAgEWJWh0dHA6Ly93d3cuQ0FjZXJ0Lm9yZy9pbmRleC5w
|
||||
aHA/aWQ9MTAwDQYJKoZIhvcNAQEEBQADggIBAH8IiKHaGlBJ2on7oQhy84r3HsQ6
|
||||
tHlbIDCxRd7CXdNlafHCXVRUPIVfuXtCkcKZ/RtRm6tGpaEQU55tiKxzbiwzpvD0
|
||||
nuB1wT6IRanhZkP+VlrRekF490DaSjrxC1uluxYG5sLnk7mFTZdPsR44Q4Dvmw2M
|
||||
77inYACHV30eRBzLI++bPJmdr7UpHEV5FpZNJ23xHGzDwlVks7wU4vOkHx4y/CcV
|
||||
Bc/dLq4+gmF78CEQGPZE6lM5+dzQmiDgxrvgu1pPxJnIB721vaLbLmINQjRBvP+L
|
||||
ivVRIqqIMADisNS8vmW61QNXeZvo3MhN+FDtkaVSKKKs+zZYPumUK5FQhxvWXtaM
|
||||
zPcPEAxSTtAWYeXlCmy/F8dyRlecmPVsYGN6b165Ti/Iubm7aoW8mA3t+T6XhDSU
|
||||
rgCvoeXnkm5OvfPi2RSLXNLrAWygF6UtEOucekq9ve7O/e0iQKtwOIj1CodqwqsF
|
||||
YMlIBdpTwd5Ed2qz8zw87YC8pjhKKSRf/lk7myV6VmMAZLldpGJ9VzZPrYPvH5JT
|
||||
oI53V93lYRE9IwCQTDz6o2CTBKOvNfYOao9PSmCnhQVsRqGP9Md246FZV/dxssRu
|
||||
FFxtbUFm3xuTsdQAw+7Lzzw9IYCpX2Nl/N3gX6T0K/CFcUHUZyX7GrGXrtaZghNB
|
||||
0m6lG5kngOcLqagA
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
|
||||
Certum_Root_CA
|
||||
|
|
Binary file not shown.
|
@ -1,3 +1,52 @@
|
|||
gajim (0.11.4-1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
* Fix tab switching. Closes: #452257
|
||||
* update to 3.7.3 Debian Policy
|
||||
* Add Homepage, Vcs-Svn, Vcs-Browser fields to control file
|
||||
|
||||
-- Yann Leboulanger <asterix@lagaule.org> Wed, 05 Dec 2007 22:23:30 +0100
|
||||
|
||||
gajim (0.11.3-1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
* Fix depand list so that Gajim will work when python2.5 will be the
|
||||
default. Closes: #445275
|
||||
* Fix focus bug. Closes: #447985
|
||||
* Depend on dnsutils to use SRV records. Closes: #434690
|
||||
|
||||
-- Yann Leboulanger <asterix@lagaule.org> Fri, 16 Nov 2007 19:01:54 +0100
|
||||
|
||||
gajim (0.11.2-1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
* Don't optionaly depend on python2.5. Closes: #418252
|
||||
* Better handle gnome-keyring. Closes: #433315, #424293
|
||||
* Handle dbus restart. Closes: #434993
|
||||
* Don't allow bookmark creation on server that don't support that.
|
||||
Closes: #438620
|
||||
* Fix list_contact dbus signature. Closes: #440225
|
||||
* Remove changelog.gz from /usr/share/doc/gajim. Closes: #412632
|
||||
|
||||
-- Yann Le Boulanger <asterix@lagaule.org> Sun, 22 Sep 2007 22:22:34 +0100
|
||||
|
||||
gajim (0.11.1-1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
* Don't depend on python2.4 specifically
|
||||
* Don't recommand libdbus, python-dbus does
|
||||
* Tooltips in chat window are now correctly destroyed. Closes: #404693
|
||||
|
||||
-- Yann Le Boulanger <asterix@lagaule.org> Sun, 18 Feb 2007 22:15:57 +0100
|
||||
|
||||
gajim (0.11-2) unstable; urgency=low
|
||||
|
||||
* Add missing build depends to get gajim-remote. Closes: #405969
|
||||
* Update recommands to support dbus. Closes: #402355
|
||||
* Make python-gnupginterface a recommanded package. Closes: #405808
|
||||
|
||||
-- Yann Le Boulanger <asterix@lagaule.org> Tue, 09 Jan 2007 18:32:26 +0100
|
||||
|
||||
gajim (0.11-1) unstable; urgency=low
|
||||
|
||||
* New upstream release. Closes: #403806
|
||||
|
|
|
@ -2,17 +2,20 @@ Source: gajim
|
|||
Section: net
|
||||
Priority: optional
|
||||
Maintainer: Yann Le Boulanger <asterix@lagaule.org>
|
||||
Build-Depends: debhelper (>= 5.0.37.2), cdbs (>= 0.4.43), python-support (>= 0.3), python-dev, libgtk2.0-dev, python-gtk2-dev, libgtkspell-dev, gettext, libxss-dev, intltool, imagemagick, python-central (>= 0.5), libdbus-1-dev
|
||||
Build-Depends: debhelper (>= 5.0.37.2), cdbs (>= 0.4.43), python-support (>= 0.7.1), python-dev, libgtk2.0-dev, python-gtk2-dev, libgtkspell-dev, gettext, libxss-dev, intltool, imagemagick, python-central (>= 0.5), libdbus-1-dev
|
||||
Build-Conflicts: python2.3
|
||||
XS-Python-Version: >= 2.4
|
||||
Standards-Version: 3.7.2
|
||||
Standards-Version: 3.7.3
|
||||
Homepage: http://www.gajim.org
|
||||
Vcs-Svn: svn://svn.gajim.org/gajim/
|
||||
Vcs-Browser: http://trac.gajim.org/browser
|
||||
|
||||
Package: gajim
|
||||
Architecture: any
|
||||
XB-Python-Version: ${python:Versions}
|
||||
Depends: ${python:Depends}, python-glade2 (>= 2.6.0), python-gtk2 (>= 2.6.0), python-pysqlite2 | python2.5
|
||||
Recommends: dnsutils, python2.4-dbus, notification-daemon, python-gnupginterface, python-pyopenssl
|
||||
Suggests: python-gnome2, nautilus-sendto, avahi-daemon, python-avahi, network-manager
|
||||
Depends: python (>= 2.4), python-support (>= 0.7.1), python-glade2 (>= 2.8.0), python-gtk2 (>= 2.8.0), python-pysqlite2 | python (>= 2.5), dnsutils
|
||||
Recommends: dbus, python-dbus, notification-daemon, python-gnupginterface, python-pyopenssl
|
||||
Suggests: python-gnome2, nautilus-sendto, avahi-daemon, python-avahi, network-manager, libgtkspell0, aspell-en, python-gnome2-desktop (>= 2.16.0)
|
||||
Description: Jabber client written in PyGTK
|
||||
Gajim is a Jabber client. It has a tabbed user interface with normal chats,
|
||||
group chats, and has many features such as, TLS, GPG, SSL, multiple accounts,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
?package(gajim): \
|
||||
needs="X11" \
|
||||
section="Apps/Net" \
|
||||
section="Applications/Network/Communication" \
|
||||
command="/usr/bin/gajim" \
|
||||
icon="/usr/share/pixmaps/gajim.xpm" \
|
||||
title="Gajim" \
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
[Setup]
|
||||
AppName=Gajim
|
||||
AppVerName=Gajim version 0.11-1
|
||||
AppVerName=Gajim version 0.11.4
|
||||
OutputBaseFilename=gajim-0.11.4-1
|
||||
DefaultDirName={pf}\Gajim
|
||||
DefaultGroupName=Gajim
|
||||
UninstallDisplayIcon={app}\src\Gajim.exe
|
||||
|
@ -27,6 +28,8 @@ Source: "dist\history_manager.exe"; DestDir: "{app}\src"; components: main
|
|||
Source: "data\*"; DestDir: "{app}\data"; Flags: recursesubdirs
|
||||
Source: "po\*.mo"; DestDir: "{app}\po"; Flags: recursesubdirs
|
||||
;Source: "gtk\*"; DestDir: "{app}\src\gtk"; Flags: recursesubdirs
|
||||
;Source: "gtk\bin\xmlparse.dll"; DestDir: "{app}\src"
|
||||
;Source: "gtk\bin\xmltok.dll"; DestDir: "{app}\src"
|
||||
|
||||
[Icons]
|
||||
Name: "{group}\Gajim"; Filename: "{app}\src\Gajim.exe"; WorkingDir: "{app}\src"
|
||||
|
|
13
launch.sh
13
launch.sh
|
@ -1,3 +1,14 @@
|
|||
#!/bin/bash
|
||||
cd `dirname $0`/src
|
||||
BASE=`pwd`/`dirname $0`
|
||||
OS=`uname -s`
|
||||
|
||||
if [ "x${OS}" == "xDarwin" ]; then
|
||||
export RESOURCEPATH="${BASE}/dist/Gajim.app/Contents/Resources"
|
||||
GTK_DIR="/Library/Frameworks/GTK+.framework/Versions/Current"
|
||||
export PATH="${GTK_DIR}/bin:$PATH"
|
||||
export PYTHONPATH="${GTK_DIR}/lib/python2.5/site-packages:${GTK_DIR}/lib/python2.5/site-packages/gtk-2.0:${PYTHONPATH}"
|
||||
unset GTK_DIR
|
||||
fi
|
||||
|
||||
cd ${BASE}/src
|
||||
exec -a gajim python -OOt gajim.py $@
|
||||
|
|
30
po/LINGUAS
30
po/LINGUAS
|
@ -1,2 +1,30 @@
|
|||
# available languages
|
||||
fr pt el pl es ru bg de nb cs nl pt_BR sv it eu sk no zh_CN br eo hr en_GB be sr gl_ES
|
||||
fr
|
||||
pt
|
||||
el
|
||||
pl
|
||||
es
|
||||
ru
|
||||
bg
|
||||
de
|
||||
nb
|
||||
cs
|
||||
nl
|
||||
pt_BR
|
||||
sv
|
||||
it
|
||||
eu
|
||||
sk
|
||||
no
|
||||
zh_CN
|
||||
br
|
||||
eo
|
||||
hr
|
||||
en_GB
|
||||
be
|
||||
be@latin
|
||||
sr
|
||||
sr@Latn
|
||||
gl
|
||||
lt
|
||||
da
|
||||
|
|
8
po/fr.po
8
po/fr.po
|
@ -2524,19 +2524,19 @@ msgstr "texte du message d'état :"
|
|||
|
||||
#: ../src/config.py:1036
|
||||
msgid "First Message Received"
|
||||
msgstr "Premier Message Reçu"
|
||||
msgstr "Premier message reçu"
|
||||
|
||||
#: ../src/config.py:1037
|
||||
msgid "Next Message Received"
|
||||
msgstr "Message Suivant Reçu"
|
||||
msgstr "Message reçu suivant"
|
||||
|
||||
#: ../src/config.py:1038
|
||||
msgid "Contact Connected"
|
||||
msgstr "Contacte Connecté"
|
||||
msgstr "Contact connecté"
|
||||
|
||||
#: ../src/config.py:1039
|
||||
msgid "Contact Disconnected"
|
||||
msgstr "Contacte déconnecté"
|
||||
msgstr "Contact déconnecté"
|
||||
|
||||
#: ../src/config.py:1040
|
||||
msgid "Message Sent"
|
||||
|
|
4612
po/pt_BR.po
4612
po/pt_BR.po
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,200 @@
|
|||
"""
|
||||
Usage:
|
||||
python setup_osx.py [build | dist]
|
||||
"""
|
||||
|
||||
from setuptools import setup
|
||||
import sys, glob, os, commands, types
|
||||
from os import system, unlink, symlink, getcwd, mkdir, utime
|
||||
from shutil import move, copy, copytree, rmtree
|
||||
|
||||
###
|
||||
### Globals
|
||||
###
|
||||
|
||||
GTK_DIR="/Library/Frameworks/GTK+.framework/Versions/Current"
|
||||
NAME = 'Gajim'
|
||||
VERSION = '0.11'
|
||||
DESCRIPTION = 'A full featured Jabber client'
|
||||
AUTHOR = 'Gajim Development Team'
|
||||
URL = 'http://www.gajim.org/'
|
||||
DOWNLOAD_URL = 'http://www.gajim.org/downloads.php'
|
||||
LICENSE = 'GPL'
|
||||
PWD = getcwd()
|
||||
APP_RS = "dist/Gajim.app/Contents/Resources"
|
||||
|
||||
GAJIM_SCRIPT = \
|
||||
'#!/bin/bash \n\
|
||||
export DYLD_LIBRARY_PATH=%s/lib \n\
|
||||
export PATH=%s/bin:$PATH \n\
|
||||
export PYTHONPATH=%s/lib/python2.5/site-packages:%s/lib/python2.5/site-packages/gtk-2.0 \n\
|
||||
exec ${0}.bin \n\
|
||||
' % (GTK_DIR, GTK_DIR, GTK_DIR, GTK_DIR)
|
||||
|
||||
GAJIM_REMOTE_SCRIPT = \
|
||||
'#!/bin/bash \n\
|
||||
export DYLD_LIBRARY_PATH=%s/lib \n\
|
||||
TOPDIR=${0%%/MacOS/gajim-remote} \n\
|
||||
echo "${TOPDIR}" | grep -e "^/" \n\
|
||||
[ $? -ne 0 ] && TOPDIR=`pwd`/${TOPDIR} \n\
|
||||
export RESOURCEPATH=${TOPDIR}/Resources \n\
|
||||
export PYTHONHOME=${RESOURCEPATH}/lib/python2.5 \n\
|
||||
export PYTHONPATH=${RESOURCEPATH}/lib/python2.5/lib-dynload:${RESOURCEPATH}/lib/python2.5/site-packages.zip:${PYTHONPATH} \n\
|
||||
cd ${RESOURCEPATH} \n\
|
||||
exec ${TOPDIR}/MacOS/Python ${RESOURCEPATH}/gajim-remote.py $* \n\
|
||||
' % GTK_DIR
|
||||
|
||||
###
|
||||
### Functions
|
||||
###
|
||||
|
||||
def check(ret):
|
||||
if type(ret) == types.ListType:
|
||||
if ret[0] != 0:
|
||||
raise Exception("Command failed: " + ret[1])
|
||||
elif type(ret) == types.IntType:
|
||||
if ret != 0:
|
||||
raise Exception("Command failed")
|
||||
return
|
||||
|
||||
|
||||
def force(func):
|
||||
try:
|
||||
func()
|
||||
except:
|
||||
pass
|
||||
return
|
||||
|
||||
|
||||
def writeScript(filename, contents):
|
||||
script = file(filename, "w+")
|
||||
script.write(contents)
|
||||
script.close()
|
||||
system("chmod +x %s" % filename)
|
||||
return
|
||||
|
||||
|
||||
def cleanup():
|
||||
force(lambda:rmtree("build"))
|
||||
force(lambda:rmtree("dist"))
|
||||
|
||||
def stageInstall():
|
||||
check(system("make DATADIR=%s/build/inst LIBDIR=%s/build/inst prefix=%s/build/inst DOCDIR=%s/build/inst/share/doc install" % (PWD, PWD, PWD, PWD)))
|
||||
force(lambda:unlink("src/osx/growl/_growl.so"))
|
||||
force(lambda:unlink("src/osx/growl/_growlImage.so"))
|
||||
force(lambda:unlink("src/osx/idle.so"))
|
||||
force(lambda:unlink("src/osx/nsapp.so"))
|
||||
force(lambda:unlink("src/osx/syncmenu.so"))
|
||||
force(lambda:unlink("src/gtkspell.so"))
|
||||
symlink("%s/build/inst/lib/gajim/_growl.so" % PWD, "src/osx/growl/_growl.so")
|
||||
symlink("%s/build/inst/lib/gajim/_growlImage.so" % PWD,
|
||||
"src/osx/growl/_growlImage.so")
|
||||
symlink("%s/build/inst/lib/gajim/idle.so" % PWD, "src/osx/idle.so")
|
||||
symlink("%s/build/inst/lib/gajim/nsapp.so" % PWD, "src/osx/nsapp.so")
|
||||
symlink("%s/build/inst/lib/gajim/syncmenu.so" % PWD, "src/osx/syncmenu.so")
|
||||
if os.path.isfile("build/inst/lib/gajim/gtkspell.so"):
|
||||
symlink("%s/build/inst/lib/gajim/gtkspell.so" % PWD, "src/gtkspell.so")
|
||||
return
|
||||
|
||||
|
||||
def buildApp():
|
||||
sys.path.append('src')
|
||||
sys.path.append(GTK_DIR + "/lib/python2.5/site-packages")
|
||||
sys.path.append(GTK_DIR + "/lib/python2.5/site-packages/gtk-2.0")
|
||||
OPTIONS = {'argv_emulation':True,
|
||||
'excludes':'docutils,Crypto,dbus,OpenSSL,cairo,gtk,gobject,atk,pangocairo',
|
||||
'iconfile':'data/pixmaps/gajim.icns',
|
||||
'includes':'osx,ConfigParser,compiler,UserString,history_manager',
|
||||
'plist':{'LSMinimumSystemVersion':'10.4.0',
|
||||
'NSHumanReadableCopyright':'GNU General Public License',
|
||||
'CFBundleIdentifier':'org.gajim',
|
||||
'NSMainNibFile':'Gajim',
|
||||
},
|
||||
}
|
||||
setup(
|
||||
name = NAME, version = VERSION, description = DESCRIPTION,
|
||||
author = AUTHOR, url = URL, download_url = DOWNLOAD_URL,
|
||||
license = LICENSE,
|
||||
app=['src/gajim.py'],
|
||||
data_files=['data/nibs/Gajim.nib'],
|
||||
options={'py2app': OPTIONS},
|
||||
setup_requires=['py2app'],
|
||||
)
|
||||
return
|
||||
|
||||
|
||||
def setupPrep():
|
||||
copy("src/osx/prep_py2app.py", APP_RS)
|
||||
move("dist/Gajim.app/Contents/Resources/__boot__.py",
|
||||
"dist/Gajim.app/Contents/Resources/__boot__.py.org")
|
||||
new = file("dist/Gajim.app/Contents/Resources/__boot__.py", "w+")
|
||||
org = file("dist/Gajim.app/Contents/Resources/__boot__.py.org")
|
||||
for line in org:
|
||||
new.write(line)
|
||||
if (('site.addsitedir' in line) and ('Python' in line)):
|
||||
new.write(" import prep_py2app\n")
|
||||
new.close()
|
||||
org.close()
|
||||
unlink("dist/Gajim.app/Contents/Resources/__boot__.py.org")
|
||||
return
|
||||
|
||||
|
||||
def finishApp():
|
||||
# setup gajim dirs
|
||||
copytree("build/inst/share/gajim/data", APP_RS + "/data")
|
||||
copy("data/pixmaps/gajim.icns", APP_RS + "/data/pixmaps")
|
||||
copytree("build/inst/locale", APP_RS + "/locale")
|
||||
copytree("build/inst/share/man", APP_RS + "/man")
|
||||
force(lambda:unlink("dist/Gajim.app/Contents/data"))
|
||||
symlink("Resources/data", "dist/Gajim.app/Contents/data")
|
||||
copy("src/gajim-remote.py", "dist/Gajim.app/Contents/Resources")
|
||||
# Nuke libs that are in the framework
|
||||
move("dist/Gajim.app/Contents/Frameworks/Python.framework",
|
||||
"dist/Gajim.app/Contents/Python.framework")
|
||||
rmtree("dist/Gajim.app/Contents/Frameworks")
|
||||
mkdir("dist/Gajim.app/Contents/Frameworks")
|
||||
move("dist/Gajim.app/Contents/Python.framework",
|
||||
"dist/Gajim.app/Contents/Frameworks/Python.framework")
|
||||
# Adjust the running of the app
|
||||
move("dist/Gajim.app/Contents/MacOS/Gajim",
|
||||
"dist/Gajim.app/Contents/MacOS/Gajim.bin")
|
||||
writeScript("dist/Gajim.app/Contents/MacOS/Gajim", GAJIM_SCRIPT)
|
||||
setupPrep()
|
||||
# Setup the gajim-remote script
|
||||
writeScript("dist/Gajim.app/Contents/MacOS/gajim-remote",
|
||||
GAJIM_REMOTE_SCRIPT)
|
||||
# Touch the top dir so Finder knows to update its idea of this bundle
|
||||
utime("dist/Gajim.app", None)
|
||||
return
|
||||
|
||||
|
||||
def distApp():
|
||||
force(lambda:rmtree("dist/Gajim"))
|
||||
force(lambda:rmtree("dist/Gajim.tar.bz2"))
|
||||
mkdir("dist/Gajim")
|
||||
check(system("tar -cf - -C dist Gajim.app | tar -xf - -C dist/Gajim"))
|
||||
copy("README.osx", "dist/Gajim/README")
|
||||
copy("TODO.osx", "dist/Gajim/TODO")
|
||||
check(system("tar -C dist -jcf dist/Gajim-OSX-`date | awk '{printf(\"%s-%s-%s\", $6, $2, $3);}'`.tar.bz2 Gajim"))
|
||||
rmtree("dist/Gajim")
|
||||
return
|
||||
|
||||
|
||||
|
||||
###
|
||||
### Start
|
||||
###
|
||||
if ((len(sys.argv) != 2) or ((sys.argv[1] != "build") and
|
||||
(sys.argv[1] != "dist"))):
|
||||
print "usage: python setup_osx.py [build]"
|
||||
print " or: python setup_osx.py [dist]"
|
||||
sys.exit(1)
|
||||
elif sys.argv[1] == "build":
|
||||
sys.argv[1] = "py2app"
|
||||
sys.argv.append('--use-pythonpath')
|
||||
cleanup()
|
||||
stageInstall()
|
||||
buildApp()
|
||||
finishApp()
|
||||
elif sys.argv[1] == "dist":
|
||||
distApp()
|
|
@ -1,17 +1,21 @@
|
|||
## setup_win32.py (run me as python setup_win32.py py2exe -O2)
|
||||
##
|
||||
## Copyright (C) 2003-2006 Yann Le Boulanger <asterix@lagaule.org>
|
||||
## Copyright (C) 2003-2007 Yann Leboulanger <asterix@lagaule.org>
|
||||
## Copyright (C) 2005-2006 Nikos Kouremenos <kourem@gmail.com>
|
||||
##
|
||||
## 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; version 2 only.
|
||||
## This file is part of Gajim.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## Gajim 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; version 3 only.
|
||||
##
|
||||
## Gajim 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 Gajim. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from distutils.core import setup
|
||||
import py2exe
|
||||
|
@ -23,7 +27,7 @@ includes = ['encodings', 'encodings.utf-8',]
|
|||
|
||||
opts = {
|
||||
'py2exe': {
|
||||
'includes': 'pango,atk,gobject,cairo,pangocairo,gtk.keysyms,encodings,encodings.*',
|
||||
'includes': 'pango,atk,gobject,cairo,pangocairo,gtk.keysyms,encodings,encodings.*,docutils.readers.*,docutils.writers.html4css1',
|
||||
'dll_excludes': [
|
||||
'iconv.dll','intl.dll','libatk-1.0-0.dll',
|
||||
'libgdk_pixbuf-2.0-0.dll','libgdk-win32-2.0-0.dll',
|
||||
|
@ -38,7 +42,7 @@ opts = {
|
|||
|
||||
setup(
|
||||
name = 'Gajim',
|
||||
version = '0.11',
|
||||
version = '0.11.4',
|
||||
description = 'A full featured Jabber client',
|
||||
author = 'Gajim Development Team',
|
||||
url = 'http://www.gajim.org/',
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
SUBDIRS = common
|
||||
SUBDIRS = common osx
|
||||
|
||||
CLEANFILES = \
|
||||
trayicon.c
|
||||
INCLUDES = \
|
||||
$(PYTHON_INCLUDES)
|
||||
export MACOSX_DEPLOYMENT_TARGET=10.4
|
||||
|
||||
if BUILD_GTKSPELL
|
||||
gtkspelllib_LTLIBRARIES = gtkspell.la
|
||||
|
|
|
@ -1,17 +1,22 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
## adhoc_commands.py
|
||||
##
|
||||
## Copyright (C) 2006 Yann Le Boulanger <asterix@lagaule.org>
|
||||
## Copyright (C) 2006 Yann Leboulanger <asterix@lagaule.org>
|
||||
## Nikos Kouremenos <nkour@jabber.org>
|
||||
##
|
||||
## 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; version 2 only.
|
||||
## This file is part of Gajim.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## Gajim 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; version 3 only.
|
||||
##
|
||||
## Gajim 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 Gajim. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# FIXME: think if we need caching command list. it may be wrong if there will
|
||||
# be entities that often change the list, it may be slow to fetch it every time
|
||||
|
@ -286,7 +291,6 @@ class CommandWindow:
|
|||
self.remove_pulsing()
|
||||
self.sending_form_progressbar.hide()
|
||||
|
||||
if not self.sessionid:
|
||||
self.sessionid = command.getAttr('sessionid')
|
||||
|
||||
self.form_status = command.getAttr('status')
|
||||
|
@ -446,7 +450,7 @@ class CommandWindow:
|
|||
# no commands => no commands stage
|
||||
# commands => command selection stage
|
||||
query = response.getTag('query')
|
||||
if query:
|
||||
if query and query.getAttr('node') == xmpp.NS_COMMANDS:
|
||||
items = query.getTags('item')
|
||||
else:
|
||||
items = []
|
||||
|
|
|
@ -1,18 +1,23 @@
|
|||
## advanced.py
|
||||
##
|
||||
## Copyright (C) 2005-2006 Yann Le Boulanger <asterix@lagaule.org>
|
||||
## Copyright (C) 2005-2006 Yann Leboulanger <asterix@lagaule.org>
|
||||
## Copyright (C) 2005-2006 Nikos Kouremenos <kourem@gmail.com>
|
||||
## Copyright (C) 2005 Vincent Hanquez <tab@snarc.org>
|
||||
##
|
||||
## 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; version 2 only.
|
||||
## This file is part of Gajim.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## Gajim 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; version 3 only.
|
||||
##
|
||||
## Gajim 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 Gajim. If not, see <http://www.gnu.org/licenses/>.
|
||||
##
|
||||
|
||||
import gtk
|
||||
import gtkgui_helpers
|
||||
|
@ -98,8 +103,7 @@ class AdvancedConfigurationWindow(object):
|
|||
make the cellrenderertext not editable else it's editable'''
|
||||
optname = model[iter][C_PREFNAME]
|
||||
opttype = model[iter][C_TYPE]
|
||||
if opttype == self.types['boolean'] or optname in ('password',
|
||||
'gpgpassword'):
|
||||
if opttype == self.types['boolean'] or optname == 'password':
|
||||
cell.set_property('editable', False)
|
||||
else:
|
||||
cell.set_property('editable', True)
|
||||
|
@ -234,7 +238,7 @@ class AdvancedConfigurationWindow(object):
|
|||
type = val[OPT_TYPE][0]
|
||||
type = self.types[type] # i18n
|
||||
value = val[OPT_VAL]
|
||||
if name in ('password', 'gpgpassword'):
|
||||
if name == 'password':
|
||||
#we talk about password
|
||||
value = _('Hidden') # override passwords with this string
|
||||
if value in self.right_true_dict:
|
||||
|
|
|
@ -3,19 +3,24 @@
|
|||
## For now greatly simplified, supports only simple feeds like the
|
||||
## one from pubsub.com.
|
||||
##
|
||||
## Copyright (C) 2006-2007 Yann Le Boulanger <asterix@lagaule.org>
|
||||
## Copyright (C) 2006-2007 Yann Leboulanger <asterix@lagaule.org>
|
||||
## Copyright (C) 2007 Nikos Kouremenos <kourem@gmail.com>
|
||||
## Copyright (C) 2006-2007 Liori (I think) put ur self here please
|
||||
##
|
||||
## 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; version 2 only.
|
||||
## This file is part of Gajim.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## Gajim 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; version 3 only.
|
||||
##
|
||||
## Gajim 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 Gajim. If not, see <http://www.gnu.org/licenses/>.
|
||||
##
|
||||
|
||||
|
||||
import gtk
|
||||
|
|
|
@ -1,27 +1,32 @@
|
|||
## cell_renderer_image.py
|
||||
##
|
||||
## Contributors for this file:
|
||||
## - Yann Le Boulanger <asterix@lagaule.org>
|
||||
## - Yann Leboulanger <asterix@lagaule.org>
|
||||
## - Nikos Kouremenos <kourem@gmail.com>
|
||||
##
|
||||
## Copyright (C) 2003-2004 Yann Le Boulanger <asterix@lagaule.org>
|
||||
## Copyright (C) 2003-2004 Yann Leboulanger <asterix@lagaule.org>
|
||||
## Vincent Hanquez <tab@snarc.org>
|
||||
## Copyright (C) 2005 Yann Le Boulanger <asterix@lagaule.org>
|
||||
## Copyright (C) 2005 Yann Leboulanger <asterix@lagaule.org>
|
||||
## Vincent Hanquez <tab@snarc.org>
|
||||
## Nikos Kouremenos <kourem@gmail.com>
|
||||
## Dimitur Kirov <dkirov@gmail.com>
|
||||
## Travis Shirk <travis@pobox.com>
|
||||
## Norman Rasmussen <norman@rasmussen.co.za>
|
||||
##
|
||||
## 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; version 2 only.
|
||||
## This file is part of Gajim.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## Gajim 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; version 3 only.
|
||||
##
|
||||
## Gajim 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 Gajim. If not, see <http://www.gnu.org/licenses/>.
|
||||
##
|
||||
|
||||
import gtk
|
||||
import gobject
|
||||
|
@ -89,6 +94,8 @@ class CellRendererImage(gtk.GenericCellRenderer):
|
|||
|
||||
if self.image.get_storage_type() == gtk.IMAGE_ANIMATION:
|
||||
if self.image not in self.iters:
|
||||
if not isinstance(widget, gtk.TreeView):
|
||||
return
|
||||
animation = self.image.get_animation()
|
||||
iter = animation.get_iter()
|
||||
self.iters[self.image] = iter
|
||||
|
|
|
@ -1,21 +1,27 @@
|
|||
## chat_control.py
|
||||
##
|
||||
## Copyright (C) 2006 Yann Le Boulanger <asterix@lagaule.org>
|
||||
## Copyright (C) 2006 Yann Leboulanger <asterix@lagaule.org>
|
||||
## Copyright (C) 2006-2007 Nikos Kouremenos <kourem@gmail.com>
|
||||
## Copyright (C) 2006 Travis Shirk <travis@pobox.com>
|
||||
## Copyright (C) 2006 Dimitur Kirov <dkirov@gmail.com>
|
||||
## Dimitur Kirov <dkirov@gmail.com>
|
||||
## Copyright (C) 2007 Lukas Petrovicky <lukas@petrovicky.net>
|
||||
## Copyright (C) 2007 Julien Pivotto <roidelapluie@gmail.com>
|
||||
## Julien Pivotto <roidelapluie@gmail.com>
|
||||
## Stephan Erb <steve-e@h3c.de>
|
||||
##
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## This file is part of Gajim.
|
||||
##
|
||||
## Gajim 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; version 2 only.
|
||||
## by the Free Software Foundation; version 3 only.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## Gajim 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 Gajim. If not, see <http://www.gnu.org/licenses/>.
|
||||
##
|
||||
|
||||
import os
|
||||
import time
|
||||
|
@ -27,6 +33,7 @@ import message_control
|
|||
import dialogs
|
||||
import history_window
|
||||
import notify
|
||||
import re
|
||||
|
||||
from common import gajim
|
||||
from common import helpers
|
||||
|
@ -45,7 +52,6 @@ try:
|
|||
except:
|
||||
HAS_GTK_SPELL = False
|
||||
|
||||
|
||||
# the next script, executed in the "po" directory,
|
||||
# generates the following list.
|
||||
##!/bin/sh
|
||||
|
@ -53,11 +59,15 @@ except:
|
|||
#echo "{_('en'):'en'",$LANG"}"
|
||||
langs = {_('English'): 'en', _('Belarusian'): 'be', _('Bulgarian'): 'bg', _('Breton'): 'br', _('Czech'): 'cs', _('German'): 'de', _('Greek'): 'el', _('British'): 'en_GB', _('Esperanto'): 'eo', _('Spanish'): 'es', _('Basque'): 'eu', _('French'): 'fr', _('Croatian'): 'hr', _('Italian'): 'it', _('Norwegian (b)'): 'nb', _('Dutch'): 'nl', _('Norwegian'): 'no', _('Polish'): 'pl', _('Portuguese'): 'pt', _('Brazilian Portuguese'): 'pt_BR', _('Russian'): 'ru', _('Serbian'): 'sr', _('Slovak'): 'sk', _('Swedish'): 'sv', _('Chinese (Ch)'): 'zh_CN'}
|
||||
|
||||
|
||||
################################################################################
|
||||
class ChatControlBase(MessageControl):
|
||||
'''A base class containing a banner, ConversationTextview, MessageTextView
|
||||
'''
|
||||
def make_href(self, match):
|
||||
url_color = gajim.config.get('urlmsgcolor')
|
||||
return '<a href="%s"><span color="%s">%s</span></a>' % (match.group(),
|
||||
url_color, match.group())
|
||||
|
||||
def get_font_attrs(self):
|
||||
''' get pango font attributes for banner from theme settings '''
|
||||
theme = gajim.config.get('roster_theme')
|
||||
|
@ -119,6 +129,9 @@ class ChatControlBase(MessageControl):
|
|||
event_keymod):
|
||||
pass # Derived should implement this rather than connecting to the event itself.
|
||||
|
||||
def status_url_clicked(self, widget, url):
|
||||
helpers.launch_browser_mailer('url', url)
|
||||
|
||||
def __init__(self, type_id, parent_win, widget_name, contact, acct,
|
||||
resource = None):
|
||||
MessageControl.__init__(self, type_id, parent_win, widget_name,
|
||||
|
@ -137,6 +150,22 @@ class ChatControlBase(MessageControl):
|
|||
id = widget.connect('button-press-event',
|
||||
self._on_banner_eventbox_button_press_event)
|
||||
self.handlers[id] = widget
|
||||
|
||||
self.urlfinder = re.compile(r"(www\.(?!\.)|[a-z][a-z0-9+.-]*://)[^\s<>'\"]+[^!,\.\s<>\)'\"\]]")
|
||||
|
||||
if gajim.HAVE_PYSEXY:
|
||||
import sexy
|
||||
self.banner_status_label = sexy.UrlLabel()
|
||||
self.banner_status_label.connect('url_activated', self.status_url_clicked)
|
||||
else:
|
||||
self.banner_status_label = gtk.Label()
|
||||
self.banner_status_label.set_selectable(True)
|
||||
self.banner_status_label.set_alignment(0,0.5)
|
||||
|
||||
banner_vbox = self.xml.get_widget('banner_vbox')
|
||||
banner_vbox.pack_start(self.banner_status_label)
|
||||
self.banner_status_label.show()
|
||||
|
||||
# Init DND
|
||||
self.TARGET_TYPE_URI_LIST = 80
|
||||
self.dnd_list = [ ( 'text/uri-list', 0, self.TARGET_TYPE_URI_LIST ),
|
||||
|
@ -151,6 +180,9 @@ class ChatControlBase(MessageControl):
|
|||
|
||||
# Create textviews and connect signals
|
||||
self.conv_textview = ConversationTextview(self.account)
|
||||
id = self.conv_textview.tv.connect('key_press_event',
|
||||
self._conv_textview_key_press_event)
|
||||
self.handlers[id] = self.conv_textview.tv
|
||||
# FIXME: DND on non editable TextView, find a better way
|
||||
self.drag_entered = False
|
||||
id = self.conv_textview.tv.connect('drag_data_received',
|
||||
|
@ -246,13 +278,14 @@ class ChatControlBase(MessageControl):
|
|||
spell.set_language(lang)
|
||||
except (gobject.GError, RuntimeError), msg:
|
||||
dialogs.AspellDictError(lang)
|
||||
self.style_event_id = 0
|
||||
self.conv_textview.tv.show()
|
||||
self._paint_banner()
|
||||
|
||||
# For JEP-0172
|
||||
self.user_nick = None
|
||||
|
||||
self.smooth = True
|
||||
|
||||
def on_msg_textview_populate_popup(self, textview, menu):
|
||||
'''we override the default context menu and we prepend an option to switch languages'''
|
||||
def _on_select_dictionary(widget, lang):
|
||||
|
@ -321,6 +354,7 @@ class ChatControlBase(MessageControl):
|
|||
banner_eventbox = self.xml.get_widget('banner_eventbox')
|
||||
banner_name_label = self.xml.get_widget('banner_name_label')
|
||||
self.disconnect_style_event(banner_name_label)
|
||||
self.disconnect_style_event(self.banner_status_label)
|
||||
if bgcolor:
|
||||
banner_eventbox.modify_bg(gtk.STATE_NORMAL,
|
||||
gtk.gdk.color_parse(bgcolor))
|
||||
|
@ -330,24 +364,32 @@ class ChatControlBase(MessageControl):
|
|||
if textcolor:
|
||||
banner_name_label.modify_fg(gtk.STATE_NORMAL,
|
||||
gtk.gdk.color_parse(textcolor))
|
||||
self.banner_status_label.modify_fg(gtk.STATE_NORMAL,
|
||||
gtk.gdk.color_parse(textcolor))
|
||||
default_fg = False
|
||||
else:
|
||||
default_fg = True
|
||||
if default_bg or default_fg:
|
||||
self._on_style_set_event(banner_name_label, None, default_fg,
|
||||
default_bg)
|
||||
self._on_style_set_event(self.banner_status_label, None, default_fg,
|
||||
default_bg)
|
||||
|
||||
def disconnect_style_event(self, widget):
|
||||
if self.style_event_id:
|
||||
widget.disconnect(self.style_event_id)
|
||||
del self.handlers[self.style_event_id]
|
||||
self.style_event_id = 0
|
||||
# Try to find the event_id
|
||||
found = False
|
||||
for id in self.handlers:
|
||||
if self.handlers[id] == widget:
|
||||
found = True
|
||||
break
|
||||
if found:
|
||||
widget.disconnect(id)
|
||||
del self.handlers[id]
|
||||
|
||||
def connect_style_event(self, widget, set_fg = False, set_bg = False):
|
||||
self.disconnect_style_event(widget)
|
||||
self.style_event_id = widget.connect('style-set',
|
||||
self._on_style_set_event, set_fg, set_bg)
|
||||
self.handlers[self.style_event_id] = widget
|
||||
id = widget.connect('style-set', self._on_style_set_event, set_fg, set_bg)
|
||||
self.handlers[id] = widget
|
||||
|
||||
def _on_style_set_event(self, widget, style, *opts):
|
||||
'''set style of widget from style class *.Frame.Eventbox
|
||||
|
@ -363,6 +405,13 @@ class ChatControlBase(MessageControl):
|
|||
widget.modify_fg(gtk.STATE_NORMAL, fg_color)
|
||||
self.connect_style_event(widget, opts[0], opts[1])
|
||||
|
||||
def _conv_textview_key_press_event(self, widget, event):
|
||||
if gtk.gtk_version < (2, 12, 0):
|
||||
return
|
||||
if event.state & (gtk.gdk.SHIFT_MASK | gtk.gdk.CONTROL_MASK):
|
||||
return False
|
||||
self.parent_win.notebook.emit('key_press_event', event)
|
||||
|
||||
def _on_keypress_event(self, widget, event):
|
||||
if event.state & gtk.gdk.CONTROL_MASK:
|
||||
# CTRL + l|L: clear conv_textview
|
||||
|
@ -389,6 +438,7 @@ class ChatControlBase(MessageControl):
|
|||
event.keyval == gtk.keysyms.Page_Up:
|
||||
self.parent_win.notebook.emit('key_press_event', event)
|
||||
return True
|
||||
|
||||
elif event.keyval == gtk.keysyms.m and \
|
||||
(event.state & gtk.gdk.MOD1_MASK): # alt + m opens emoticons menu
|
||||
if gajim.config.get('emoticons_theme'):
|
||||
|
@ -712,10 +762,11 @@ class ChatControlBase(MessageControl):
|
|||
if not jid:
|
||||
jid = self.contact.jid
|
||||
|
||||
if gajim.interface.instances['logs'].has_key(jid):
|
||||
gajim.interface.instances['logs'][jid].window.present()
|
||||
if gajim.interface.instances.has_key('logs'):
|
||||
gajim.interface.instances['logs'].window.present()
|
||||
gajim.interface.instances['logs'].open_history(jid, self.account)
|
||||
else:
|
||||
gajim.interface.instances['logs'][jid] = \
|
||||
gajim.interface.instances['logs'] = \
|
||||
history_window.HistoryWindow(jid, self.account)
|
||||
|
||||
def on_minimize_menuitem_toggled(self, widget):
|
||||
|
@ -812,9 +863,10 @@ class ChatControlBase(MessageControl):
|
|||
self.msg_scrolledwindow.set_property('vscrollbar-policy',
|
||||
gtk.POLICY_NEVER)
|
||||
self.msg_scrolledwindow.set_property('height-request', -1)
|
||||
|
||||
self.conv_textview.bring_scroll_to_end(diff_y - 18)
|
||||
|
||||
self.conv_textview.bring_scroll_to_end(diff_y - 18, False)
|
||||
else:
|
||||
self.conv_textview.bring_scroll_to_end(diff_y - 18, self.smooth)
|
||||
self.smooth = True # reinit the flag
|
||||
# enable scrollbar automatic policy for horizontal scrollbar
|
||||
# if message we have in message_textview is too big
|
||||
if requisition.width > message_width:
|
||||
|
@ -895,6 +947,7 @@ class ChatControlBase(MessageControl):
|
|||
if self.sent_history_pos == 0:
|
||||
return
|
||||
self.sent_history_pos = self.sent_history_pos - 1
|
||||
self.smooth = False
|
||||
conv_buf.set_text(self.sent_history[self.sent_history_pos])
|
||||
elif direction == 'down':
|
||||
if self.sent_history_pos >= size - 1:
|
||||
|
@ -904,6 +957,7 @@ class ChatControlBase(MessageControl):
|
|||
return
|
||||
|
||||
self.sent_history_pos = self.sent_history_pos + 1
|
||||
self.smooth = False
|
||||
conv_buf.set_text(self.sent_history[self.sent_history_pos])
|
||||
|
||||
def lighten_color(self, color):
|
||||
|
@ -949,7 +1003,7 @@ class ChatControl(ChatControlBase):
|
|||
old_msg_kind = None # last kind of the printed message
|
||||
CHAT_CMDS = ['clear', 'compact', 'help', 'me', 'ping', 'say']
|
||||
|
||||
def __init__(self, parent_win, contact, acct, resource = None):
|
||||
def __init__(self, parent_win, contact, acct, session, resource = None):
|
||||
ChatControlBase.__init__(self, self.TYPE_ID, parent_win,
|
||||
'chat_child_vbox', contact, acct, resource)
|
||||
|
||||
|
@ -1003,6 +1057,8 @@ class ChatControl(ChatControlBase):
|
|||
if self.contact.jid in gajim.encrypted_chats[self.account]:
|
||||
self.xml.get_widget('gpg_togglebutton').set_active(True)
|
||||
|
||||
self.set_session(session)
|
||||
|
||||
self.status_tooltip = gtk.Tooltips()
|
||||
self.update_ui()
|
||||
# restore previous conversation
|
||||
|
@ -1045,7 +1101,7 @@ class ChatControl(ChatControlBase):
|
|||
menuitem = gtk.ImageMenuItem(gtk.STOCK_SAVE_AS)
|
||||
id = menuitem.connect('activate',
|
||||
gtkgui_helpers.on_avatar_save_as_menuitem_activate,
|
||||
self.contact.jid, self.account, self.contact.get_shown_name() +
|
||||
self.contact.jid, self.account, self.contact.get_shown_name() + \
|
||||
'.jpeg')
|
||||
self.handlers[id] = menuitem
|
||||
menu.append(menuitem)
|
||||
|
@ -1146,11 +1202,10 @@ class ChatControl(ChatControlBase):
|
|||
|
||||
status = contact.status
|
||||
if status is not None:
|
||||
self.status_tooltip.set_tip(banner_eventbox, status)
|
||||
self.status_tooltip.enable()
|
||||
banner_name_label.set_ellipsize(pango.ELLIPSIZE_END)
|
||||
status = helpers.reduce_chars_newlines(status, max_lines = 1)
|
||||
status_escaped = gobject.markup_escape_text(status)
|
||||
self.banner_status_label.set_ellipsize(pango.ELLIPSIZE_END)
|
||||
status_reduced = helpers.reduce_chars_newlines(status, max_lines = 1)
|
||||
status_escaped = gobject.markup_escape_text(status_reduced)
|
||||
|
||||
font_attrs, font_attrs_small = self.get_font_attrs()
|
||||
st = gajim.config.get('displayed_chat_state_notifications')
|
||||
|
@ -1179,11 +1234,23 @@ class ChatControl(ChatControlBase):
|
|||
# weight="heavy" size="x-large"
|
||||
label_text = '<span %s>%s</span><span %s>%s</span>' % \
|
||||
(font_attrs, name, font_attrs_small, acct_info)
|
||||
|
||||
if status_escaped:
|
||||
label_text += '\n<span %s>%s</span>' %\
|
||||
(font_attrs_small, status_escaped)
|
||||
if gajim.HAVE_PYSEXY:
|
||||
status_text = self.urlfinder.sub(self.make_href, status_escaped)
|
||||
status_text = '<span %s>%s</span>' % (font_attrs_small, status_text)
|
||||
else:
|
||||
status_text = '<span %s>%s</span>' % (font_attrs_small, status_escaped)
|
||||
self.status_tooltip.set_tip(banner_eventbox, status)
|
||||
self.banner_status_label.show()
|
||||
self.banner_status_label.set_no_show_all(False)
|
||||
else:
|
||||
status_text = ''
|
||||
self.status_tooltip.disable()
|
||||
self.banner_status_label.hide()
|
||||
self.banner_status_label.set_no_show_all(True)
|
||||
|
||||
self.banner_status_label.set_markup(status_text)
|
||||
# setup the label that holds name and jid
|
||||
banner_name_label.set_markup(label_text)
|
||||
|
||||
|
@ -1231,7 +1298,11 @@ class ChatControl(ChatControlBase):
|
|||
message_array = []
|
||||
|
||||
if command == 'me':
|
||||
return False # This is not really a command
|
||||
if len(message_array):
|
||||
return False # /me is not really a command
|
||||
else:
|
||||
self.get_command_help(command)
|
||||
return True # do not send "/me" as message
|
||||
|
||||
if command == 'help':
|
||||
if len(message_array):
|
||||
|
@ -1295,13 +1366,13 @@ class ChatControl(ChatControlBase):
|
|||
|
||||
contact = self.contact
|
||||
|
||||
encrypted = bool(self.session) and self.session.enable_encryption
|
||||
|
||||
keyID = ''
|
||||
encrypted = False
|
||||
if self.xml.get_widget('gpg_togglebutton').get_active():
|
||||
keyID = contact.keyID
|
||||
encrypted = True
|
||||
|
||||
|
||||
chatstates_on = gajim.config.get('outgoing_chat_state_notifications') != \
|
||||
'disabled'
|
||||
composing_xep = contact.composing_xep
|
||||
|
@ -1393,6 +1464,26 @@ class ChatControl(ChatControlBase):
|
|||
self.mouse_over_in_last_30_secs = False
|
||||
self.kbd_activity_in_last_30_secs = False
|
||||
|
||||
def on_cancel_session_negotiation(self):
|
||||
msg = _('Session negotiation cancelled')
|
||||
ChatControlBase.print_conversation_line(self, msg, 'status', '', None)
|
||||
|
||||
# print esession settings to textview
|
||||
def print_esession_details(self):
|
||||
if self.session and self.session.enable_encryption:
|
||||
msg = _('E2E encryption enabled')
|
||||
ChatControlBase.print_conversation_line(self, msg, 'status', '', None)
|
||||
|
||||
if self.session.loggable:
|
||||
msg = _('Session WILL be logged')
|
||||
else:
|
||||
msg = _('Session WILL NOT be logged')
|
||||
|
||||
ChatControlBase.print_conversation_line(self, msg, 'status', '', None)
|
||||
else:
|
||||
msg = _('E2E encryption disabled')
|
||||
ChatControlBase.print_conversation_line(self, msg, 'status', '', None)
|
||||
|
||||
def print_conversation(self, text, frm = '', tim = None,
|
||||
encrypted = False, subject = None, xhtml = None):
|
||||
'''Print a line in the conversation:
|
||||
|
@ -1412,18 +1503,26 @@ class ChatControl(ChatControlBase):
|
|||
kind = 'info'
|
||||
name = ''
|
||||
else:
|
||||
if self.session and self.session.enable_encryption:
|
||||
if not encrypted:
|
||||
msg = _('The following message was NOT encrypted')
|
||||
ChatControlBase.print_conversation_line(self, msg,
|
||||
'status', '', tim)
|
||||
else:
|
||||
# GPG encryption
|
||||
ec = gajim.encrypted_chats[self.account]
|
||||
if encrypted and jid not in ec:
|
||||
msg = _('Encryption enabled')
|
||||
msg = _('OpenPGP Encryption enabled')
|
||||
ChatControlBase.print_conversation_line(self, msg,
|
||||
'status', '', tim)
|
||||
ec.append(jid)
|
||||
elif not encrypted and jid in ec:
|
||||
msg = _('Encryption disabled')
|
||||
msg = _('OpenPGP Encryption disabled')
|
||||
ChatControlBase.print_conversation_line(self, msg,
|
||||
'status', '', tim)
|
||||
ec.remove(jid)
|
||||
self.xml.get_widget('gpg_togglebutton').set_active(encrypted)
|
||||
|
||||
if not frm:
|
||||
kind = 'incoming'
|
||||
name = contact.get_shown_name()
|
||||
|
@ -1533,17 +1632,24 @@ class ChatControl(ChatControlBase):
|
|||
|
||||
history_menuitem = xml.get_widget('history_menuitem')
|
||||
toggle_gpg_menuitem = xml.get_widget('toggle_gpg_menuitem')
|
||||
toggle_e2e_menuitem = xml.get_widget('toggle_e2e_menuitem')
|
||||
add_to_roster_menuitem = xml.get_widget('add_to_roster_menuitem')
|
||||
send_file_menuitem = xml.get_widget('send_file_menuitem')
|
||||
information_menuitem = xml.get_widget('information_menuitem')
|
||||
convert_to_gc_menuitem = xml.get_widget('convert_to_groupchat')
|
||||
muc_icon = gajim.interface.roster.load_icon('muc_active')
|
||||
if muc_icon:
|
||||
convert_to_gc_menuitem.set_image(muc_icon)
|
||||
|
||||
ag = gtk.accel_groups_from_object(self.parent_win.window)[0]
|
||||
history_menuitem.add_accelerator('activate', ag, gtk.keysyms.h, gtk.gdk.CONTROL_MASK,
|
||||
gtk.ACCEL_VISIBLE)
|
||||
information_menuitem.add_accelerator('activate', ag, gtk.keysyms.i,
|
||||
gtk.gdk.CONTROL_MASK, gtk.ACCEL_VISIBLE)
|
||||
|
||||
contact = self.parent_win.get_active_contact()
|
||||
jid = contact.jid
|
||||
|
||||
# history_menuitem
|
||||
if gajim.jid_is_transport(jid):
|
||||
history_menuitem.set_sensitive(False)
|
||||
|
||||
# check if gpg capabitlies or else make gpg toggle insensitive
|
||||
gpg_btn = self.xml.get_widget('gpg_togglebutton')
|
||||
isactive = gpg_btn.get_active()
|
||||
|
@ -1551,6 +1657,13 @@ class ChatControl(ChatControlBase):
|
|||
toggle_gpg_menuitem.set_active(isactive)
|
||||
toggle_gpg_menuitem.set_property('sensitive', is_sensitive)
|
||||
|
||||
# TODO: check that the remote client supports e2e
|
||||
if not gajim.HAVE_PYCRYPTO:
|
||||
toggle_e2e_menuitem.set_sensitive(False)
|
||||
else:
|
||||
isactive = int(self.session != None and self.session.enable_encryption)
|
||||
toggle_e2e_menuitem.set_active(isactive)
|
||||
|
||||
# If we don't have resource, we can't do file transfer
|
||||
# in transports, contact holds our info we need to disable it too
|
||||
if self.TYPE_ID == message_control.TYPE_PM and self.gc_contact.jid and \
|
||||
|
@ -1561,6 +1674,11 @@ class ChatControl(ChatControlBase):
|
|||
else:
|
||||
send_file_menuitem.set_sensitive(False)
|
||||
|
||||
# check if it's possible to convert to groupchat
|
||||
if gajim.get_transport_name_from_jid(jid) or \
|
||||
gajim.connections[self.account].is_zeroconf:
|
||||
convert_to_gc_menuitem.set_sensitive(False)
|
||||
|
||||
# add_to_roster_menuitem
|
||||
if _('Not in Roster') in contact.groups:
|
||||
add_to_roster_menuitem.show()
|
||||
|
@ -1569,7 +1687,6 @@ class ChatControl(ChatControlBase):
|
|||
add_to_roster_menuitem.hide()
|
||||
add_to_roster_menuitem.set_no_show_all(True)
|
||||
|
||||
|
||||
# connect signals
|
||||
id = history_menuitem.connect('activate',
|
||||
self._on_history_menuitem_activate)
|
||||
|
@ -1582,13 +1699,27 @@ class ChatControl(ChatControlBase):
|
|||
self.handlers[id] = add_to_roster_menuitem
|
||||
id = toggle_gpg_menuitem.connect('activate',
|
||||
self._on_toggle_gpg_menuitem_activate)
|
||||
id = toggle_e2e_menuitem.connect('activate',
|
||||
self._on_toggle_e2e_menuitem_activate)
|
||||
self.handlers[id] = toggle_gpg_menuitem
|
||||
id = information_menuitem.connect('activate',
|
||||
self._on_contact_information_menuitem_activate)
|
||||
self.handlers[id] = information_menuitem
|
||||
menu.connect('selection-done', lambda w:w.destroy())
|
||||
id = convert_to_gc_menuitem.connect('activate',
|
||||
self._on_convert_to_gc_menuitem_activate)
|
||||
self.handlers[id] = convert_to_gc_menuitem
|
||||
menu.connect('selection-done', self.destroy_menu, history_menuitem,
|
||||
information_menuitem)
|
||||
return menu
|
||||
|
||||
def destroy_menu(self, menu, history_menuitem, information_menuitem):
|
||||
# destroy accelerators
|
||||
ag = gtk.accel_groups_from_object(self.parent_win.window)[0]
|
||||
history_menuitem.remove_accelerator(ag, gtk.keysyms.h, gtk.gdk.CONTROL_MASK)
|
||||
information_menuitem.remove_accelerator(ag, gtk.keysyms.i, gtk.gdk.CONTROL_MASK)
|
||||
# destroy menu
|
||||
menu.destroy()
|
||||
|
||||
def send_chatstate(self, state, contact = None):
|
||||
''' sends OUR chatstate as STANDLONE chat state message (eg. no body)
|
||||
to contact only if new chatstate is different from the previous one
|
||||
|
@ -1766,15 +1897,14 @@ class ChatControl(ChatControlBase):
|
|||
|
||||
def _on_drag_data_received(self, widget, context, x, y, selection,
|
||||
target_type, timestamp):
|
||||
# If no resource is known, we can't send a file
|
||||
if not selection.data:
|
||||
return
|
||||
if self.TYPE_ID == message_control.TYPE_PM:
|
||||
c = self.gc_contact
|
||||
else:
|
||||
c = self.contact
|
||||
if not c.resource:
|
||||
return
|
||||
if target_type == self.TARGET_TYPE_URI_LIST:
|
||||
if not selection.data:
|
||||
if not c.resource: # If no resource is known, we can't send a file
|
||||
return
|
||||
uri = selection.data.strip()
|
||||
uri_splitted = uri.split() # we may have more than one file dropped
|
||||
|
@ -1783,6 +1913,26 @@ class ChatControl(ChatControlBase):
|
|||
if os.path.isfile(path): # is it file?
|
||||
ft = gajim.interface.instances['file_transfers']
|
||||
ft.send_file(self.account, c, path)
|
||||
return
|
||||
|
||||
# chat2muc
|
||||
treeview = gajim.interface.roster.tree
|
||||
model = treeview.get_model()
|
||||
data = selection.data
|
||||
path = treeview.get_selection().get_selected_rows()[1][0]
|
||||
iter = model.get_iter(path)
|
||||
type = model[iter][2]
|
||||
account = model[iter][4].decode('utf-8')
|
||||
if type != 'contact': # source is not a contact
|
||||
return
|
||||
dropped_jid = data.decode('utf-8')
|
||||
|
||||
dropped_transport = gajim.get_transport_name_from_jid(dropped_jid)
|
||||
c_transport = gajim.get_transport_name_from_jid(c.jid)
|
||||
if dropped_transport or c_transport:
|
||||
return # transport contacts cannot be invited
|
||||
|
||||
dialogs.TransformChatToMUC(self.account, [c.jid], [dropped_jid])
|
||||
|
||||
def _on_message_tv_buffer_changed(self, textbuffer):
|
||||
self.kbd_activity_in_last_5_secs = True
|
||||
|
@ -1850,12 +2000,16 @@ class ChatControl(ChatControlBase):
|
|||
|
||||
def read_queue(self):
|
||||
'''read queue and print messages containted in it'''
|
||||
|
||||
jid = self.contact.jid
|
||||
jid_with_resource = jid
|
||||
if self.resource:
|
||||
jid_with_resource += '/' + self.resource
|
||||
events = gajim.events.get_events(self.account, jid_with_resource)
|
||||
|
||||
if hasattr(self, 'session') and self.session and self.session.enable_encryption:
|
||||
self.print_esession_details()
|
||||
|
||||
# Is it a pm ?
|
||||
is_pm = False
|
||||
room_jid, nick = gajim.get_room_and_nick_from_fjid(jid)
|
||||
|
@ -1877,6 +2031,9 @@ class ChatControl(ChatControlBase):
|
|||
encrypted = data[4], subject = data[1], xhtml = data[7])
|
||||
if len(data) > 6 and isinstance(data[6], int):
|
||||
message_ids.append(data[6])
|
||||
|
||||
if len(data) > 8:
|
||||
self.set_session(data[8])
|
||||
if message_ids:
|
||||
gajim.logger.set_read_messages(message_ids)
|
||||
gajim.events.remove_events(self.account, jid_with_resource,
|
||||
|
@ -1943,6 +2100,8 @@ class ChatControl(ChatControlBase):
|
|||
# so this line adds that
|
||||
window.set_events(gtk.gdk.POINTER_MOTION_MASK)
|
||||
window.set_app_paintable(True)
|
||||
if gtk.gtk_version >= (2, 10, 0) and gtk.pygtk_version >= (2, 10, 0):
|
||||
window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_TOOLTIP)
|
||||
|
||||
window.realize()
|
||||
window.window.set_back_pixmap(pixmap, False) # make it transparent
|
||||
|
@ -2000,6 +2159,31 @@ class ChatControl(ChatControlBase):
|
|||
tb = self.xml.get_widget('gpg_togglebutton')
|
||||
tb.set_active(not tb.get_active())
|
||||
|
||||
def _on_convert_to_gc_menuitem_activate(self, widget):
|
||||
'''user want to invite some friends to chat'''
|
||||
dialogs.TransformChatToMUC(self.account, [self.contact.jid])
|
||||
|
||||
def _on_toggle_e2e_menuitem_activate(self, widget):
|
||||
if self.session and self.session.enable_encryption:
|
||||
self.session.terminate_e2e()
|
||||
|
||||
self.print_esession_details()
|
||||
|
||||
jid = str(self.session.jid)
|
||||
|
||||
gajim.connections[self.account].delete_session(jid,
|
||||
self.session.thread_id)
|
||||
|
||||
self.set_session(gajim.connections[self.account].make_new_session(jid))
|
||||
else:
|
||||
if not self.session:
|
||||
fjid = self.contact.get_full_jid()
|
||||
new_sess = gajim.connections[self.account].make_new_session(fjid)
|
||||
self.set_session(new_sess)
|
||||
|
||||
# XXX decide whether to use 4 or 3 message negotiation
|
||||
self.session.negotiate_e2e(False)
|
||||
|
||||
def got_connected(self):
|
||||
ChatControlBase.got_connected(self)
|
||||
# Refreshing contact
|
||||
|
|
|
@ -1,27 +1,32 @@
|
|||
## common/GnuPG.py
|
||||
##
|
||||
## Contributors for this file:
|
||||
## - Yann Le Boulanger <asterix@lagaule.org>
|
||||
## - Yann Leboulanger <asterix@lagaule.org>
|
||||
## - Nikos Kouremenos <kourem@gmail.com>
|
||||
##
|
||||
## Copyright (C) 2003-2004 Yann Le Boulanger <asterix@lagaule.org>
|
||||
## Copyright (C) 2003-2004 Yann Leboulanger <asterix@lagaule.org>
|
||||
## Vincent Hanquez <tab@snarc.org>
|
||||
## Copyright (C) 2005 Yann Le Boulanger <asterix@lagaule.org>
|
||||
## Copyright (C) 2005 Yann Leboulanger <asterix@lagaule.org>
|
||||
## Vincent Hanquez <tab@snarc.org>
|
||||
## Nikos Kouremenos <kourem@gmail.com>
|
||||
## Dimitur Kirov <dkirov@gmail.com>
|
||||
## Travis Shirk <travis@pobox.com>
|
||||
## Norman Rasmussen <norman@rasmussen.co.za>
|
||||
##
|
||||
## 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; version 2 only.
|
||||
## This file is part of Gajim.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## Gajim 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; version 3 only.
|
||||
##
|
||||
## Gajim 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 Gajim. If not, see <http://www.gnu.org/licenses/>.
|
||||
##
|
||||
|
||||
import os
|
||||
from os import tmpfile
|
||||
|
@ -87,19 +92,36 @@ else:
|
|||
return str, 'GnuPG not usable'
|
||||
self.options.recipients = recipients # a list!
|
||||
|
||||
proc = self.run(['--encrypt'], create_fhs=['stdin', 'stdout',
|
||||
proc = self.run(['--encrypt'], create_fhs=['stdin', 'stdout', 'status',
|
||||
'stderr'])
|
||||
proc.handles['stdin'].write(str)
|
||||
try:
|
||||
proc.handles['stdin'].close()
|
||||
except IOError:
|
||||
pass
|
||||
|
||||
output = proc.handles['stdout'].read()
|
||||
try:
|
||||
proc.handles['stdout'].close()
|
||||
except IOError:
|
||||
pass
|
||||
|
||||
stat = proc.handles['status']
|
||||
resp = self._read_response(stat)
|
||||
try:
|
||||
proc.handles['status'].close()
|
||||
except IOError:
|
||||
pass
|
||||
|
||||
error = proc.handles['stderr'].read()
|
||||
proc.handles['stderr'].close()
|
||||
|
||||
try: proc.wait()
|
||||
except IOError: pass
|
||||
if 'BEGIN_ENCRYPTION' in resp and 'END_ENCRYPTION' in resp:
|
||||
# Encryption succeeded, even if there is output on stderr. Maybe
|
||||
# verbose is on
|
||||
error = ''
|
||||
return self._stripHeaderFooter(output), error
|
||||
|
||||
def decrypt(self, str, keyID):
|
||||
|
|
|
@ -213,6 +213,9 @@ 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
|
||||
Lesser General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with Gajim. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
|
|
|
@ -1,15 +1,20 @@
|
|||
##
|
||||
## Copyright (C) 2006 Gajim Team
|
||||
##
|
||||
## 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; version 2 only.
|
||||
## This file is part of Gajim.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## Gajim 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; version 3 only.
|
||||
##
|
||||
## Gajim 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 Gajim. If not, see <http://www.gnu.org/licenses/>.
|
||||
##
|
||||
|
||||
from itertools import *
|
||||
import xmpp
|
||||
|
@ -244,7 +249,7 @@ class ConnectionCaps(object):
|
|||
if not contact: return
|
||||
if not contact.caps_node: return # we didn't asked for that?
|
||||
if not node.startswith(contact.caps_node+'#'): return
|
||||
node, ext = node.split('#')
|
||||
node, ext = node.split('#', 1)
|
||||
if ext==contact.caps_ver: # this can be also version (like '0.9')
|
||||
exts=None
|
||||
else:
|
||||
|
|
|
@ -1,17 +1,22 @@
|
|||
##
|
||||
## Copyright (C) 2005-2006 Yann Le Boulanger <asterix@lagaule.org>
|
||||
## Copyright (C) 2005-2006 Yann Leboulanger <asterix@lagaule.org>
|
||||
## Copyright (C) 2005-2006 Nikos Kouremenos <kourem@gmail.com>
|
||||
## Copyright (C) 2005-2006 Travis Shirk <travis@pobox.com>
|
||||
##
|
||||
## 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; version 2 only.
|
||||
## This file is part of Gajim.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## Gajim 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; version 3 only.
|
||||
##
|
||||
## Gajim 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 Gajim. If not, see <http://www.gnu.org/licenses/>.
|
||||
##
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
|
|
@ -1,15 +1,20 @@
|
|||
##
|
||||
## Copyright (C) 2006 Gajim Team
|
||||
##
|
||||
## 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; version 2 only.
|
||||
## This file is part of Gajim.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## Gajim 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; version 3 only.
|
||||
##
|
||||
## Gajim 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 Gajim. If not, see <http://www.gnu.org/licenses/>.
|
||||
##
|
||||
|
||||
import xmpp
|
||||
import helpers
|
||||
|
@ -162,7 +167,7 @@ def find_current_groupchats(account):
|
|||
|
||||
class LeaveGroupchatsCommand(AdHocCommand):
|
||||
commandnode = 'leave-groupchats'
|
||||
commandname = 'Leave Groupchats'
|
||||
commandname = _('Leave Groupchats')
|
||||
|
||||
@staticmethod
|
||||
def isVisibleFor(samejid):
|
||||
|
@ -288,6 +293,8 @@ class ConnectionCommands:
|
|||
iq = iq_obj.buildReply('result')
|
||||
jid = helpers.get_full_jid_from_iq(iq_obj)
|
||||
q = iq.getTag('query')
|
||||
# buildReply don't copy the node attribute. Re-add it
|
||||
q.setAttr('node', xmpp.NS_COMMANDS)
|
||||
|
||||
for node, cmd in self.__commands.iteritems():
|
||||
if cmd.isVisibleFor(self.isSameJID(jid)):
|
||||
|
@ -299,8 +306,8 @@ class ConnectionCommands:
|
|||
|
||||
self.connection.send(iq)
|
||||
|
||||
def commandQuery(self, con, iq_obj):
|
||||
''' Send disco result for query for command (JEP-0050, example 6.).
|
||||
def commandInfoQuery(self, con, iq_obj):
|
||||
''' Send disco#info result for query for command (JEP-0050, example 6.).
|
||||
Return True if the result was sent, False if not. '''
|
||||
jid = helpers.get_full_jid_from_iq(iq_obj)
|
||||
node = iq_obj.getTagAttr('query', 'node')
|
||||
|
@ -323,6 +330,22 @@ class ConnectionCommands:
|
|||
|
||||
return False
|
||||
|
||||
def commandItemsQuery(self, con, iq_obj):
|
||||
''' Send disco#items result for query for command.
|
||||
Return True if the result was sent, False if not. '''
|
||||
jid = helpers.get_full_jid_from_iq(iq_obj)
|
||||
node = iq_obj.getTagAttr('query', 'node')
|
||||
|
||||
if node not in self.__commands: return False
|
||||
|
||||
cmd = self.__commands[node]
|
||||
if cmd.isVisibleFor(self.isSameJID(jid)):
|
||||
iq = iq_obj.buildReply('result')
|
||||
self.connection.send(iq)
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
def _CommandExecuteCB(self, con, iq_obj):
|
||||
jid = helpers.get_full_jid_from_iq(iq_obj)
|
||||
|
||||
|
|
|
@ -1,25 +1,32 @@
|
|||
## common/config.py
|
||||
##
|
||||
## Copyright (C) 2003-2006 Yann Le Boulanger <asterix@lagaule.org>
|
||||
## Copyright (C) 2003-2007 Yann Leboulanger <asterix@lagaule.org>
|
||||
## Copyright (C) 2005-2006 Nikos Kouremenos <kourem@gmail.com>
|
||||
## Copyright (C) 2004-2005 Vincent Hanquez <tab@snarc.org>
|
||||
## Copyright (C) 2005 Dimitur Kirov <dkirov@gmail.com>
|
||||
## Copyright (C) 2005 Travis Shirk <travis@pobox.com>
|
||||
## Copyright (C) 2005 Norman Rasmussen <norman@rasmussen.co.za>
|
||||
## Travis Shirk <travis@pobox.com>
|
||||
## Norman Rasmussen <norman@rasmussen.co.za>
|
||||
## Copyright (C) 2006 Stefan Bethge <stefan@lanpartei.de>
|
||||
## Copyright (C) 2007 Julien Pivotto <roidelapluie@gmail.com>
|
||||
## Stephan Erb <steve-e@h3c.de>
|
||||
##
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## This file is part of Gajim.
|
||||
##
|
||||
## Gajim 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; version 2 only.
|
||||
## by the Free Software Foundation; version 3 only.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## Gajim 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 Gajim. If not, see <http://www.gnu.org/licenses/>.
|
||||
##
|
||||
|
||||
|
||||
import sys
|
||||
import re
|
||||
import copy
|
||||
import defs
|
||||
|
@ -44,6 +51,16 @@ opt_treat_incoming_messages = ['', 'chat', 'normal']
|
|||
class Config:
|
||||
|
||||
DEFAULT_ICONSET = 'dcraven'
|
||||
if sys.platform == 'darwin':
|
||||
DEFAULT_OPENWITH = 'open'
|
||||
DEFAULT_BROWSER = 'open -a Safari'
|
||||
DEFAULT_MAILAPP = 'open -a Mail'
|
||||
DEFAULT_FILE_MANAGER = 'open -a Finder'
|
||||
else:
|
||||
DEFAULT_OPENWITH = 'gnome-open'
|
||||
DEFAULT_BROWSER = 'firefox'
|
||||
DEFAULT_MAILAPP = 'mozilla-thunderbird -compose'
|
||||
DEFAULT_FILE_MANAGER = 'xffm'
|
||||
|
||||
__options = {
|
||||
# name: [ type, default_value, help_string ]
|
||||
|
@ -102,10 +119,10 @@ class Config:
|
|||
'sounds_on': [ opt_bool, True ],
|
||||
# 'aplay', 'play', 'esdplay', 'artsplay' detected first time only
|
||||
'soundplayer': [ opt_str, '' ],
|
||||
'openwith': [ opt_str, 'gnome-open' ],
|
||||
'custombrowser': [ opt_str, 'firefox' ],
|
||||
'custommailapp': [ opt_str, 'mozilla-thunderbird -compose' ],
|
||||
'custom_file_manager': [ opt_str, 'xffm' ],
|
||||
'openwith': [ opt_str, DEFAULT_OPENWITH ],
|
||||
'custombrowser': [ opt_str, DEFAULT_BROWSER ],
|
||||
'custommailapp': [ opt_str, DEFAULT_MAILAPP ],
|
||||
'custom_file_manager': [ opt_str, DEFAULT_FILE_MANAGER ],
|
||||
'gc-hpaned-position': [opt_int, 430],
|
||||
'gc_refer_to_nick_char': [opt_str, ',', _('Character to add after nickname when using nick completion (tab) in group chat.')],
|
||||
'gc_proposed_nick_char': [opt_str, '_', _('Character to propose to add after desired nickname when desired nickname is used by someone else in group chat.')],
|
||||
|
@ -127,7 +144,7 @@ class Config:
|
|||
'single-msg-height': [opt_int, 280],
|
||||
'roster_x-position': [ opt_int, 0 ],
|
||||
'roster_y-position': [ opt_int, 0 ],
|
||||
'roster_width': [ opt_int, 150 ],
|
||||
'roster_width': [ opt_int, 200 ],
|
||||
'roster_height': [ opt_int, 400 ],
|
||||
'latest_disco_addresses': [ opt_str, '' ],
|
||||
'recently_groupchat': [ opt_str, '' ],
|
||||
|
@ -136,9 +153,10 @@ class Config:
|
|||
'after_nickname': [ opt_str, ':', _('Characters that are printed after the nickname in conversations') ],
|
||||
'send_os_info': [ opt_bool, True ],
|
||||
'set_status_msg_from_current_music_track': [ opt_bool, False ],
|
||||
'set_status_msg_from_lastfm': [ opt_bool, False, _('If checked, Gajim can regularly poll a Last.fm account and adjust the status message to reflect recently played songs. set_status_msg_from_current_music_track option must be False.') ],
|
||||
'lastfm_username': [ opt_str, '', _('The username used to identify the Last.fm account.')],
|
||||
'notify_on_new_gmail_email': [ opt_bool, True ],
|
||||
'notify_on_new_gmail_email_extra': [ opt_bool, False ],
|
||||
'usegpg': [ opt_bool, False, '', True ],
|
||||
'use_gpg_agent': [ opt_bool, False ],
|
||||
'change_roster_title': [ opt_bool, True, _('Add * and [n] in roster title?')],
|
||||
'restore_lines': [opt_int, 4, _('How many lines to remember from previous conversation when a chat tab/window is reopened.')],
|
||||
|
@ -175,6 +193,8 @@ class Config:
|
|||
'tabs_always_visible': [opt_bool, False, _('Show tab when only one conversation?')],
|
||||
'tabs_border': [opt_bool, False, _('Show tabbed notebook border in chat windows?')],
|
||||
'tabs_close_button': [opt_bool, True, _('Show close button in tab?')],
|
||||
'log_encrypted_sessions': [opt_bool, False, _('When negotiating an encrypted session, should Gajim assume you want your messages to be logged?')],
|
||||
'e2e_public_key': [opt_bool, False, _('When negotiating an encrypted session, should Gajim prefer to use public keys for identification?')],
|
||||
'chat_avatar_width': [opt_int, 52],
|
||||
'chat_avatar_height': [opt_int, 52],
|
||||
'roster_avatar_width': [opt_int, 32],
|
||||
|
@ -218,6 +238,7 @@ class Config:
|
|||
'hide_groupchat_occupants_list': [opt_bool, False, _('Hides the group chat occupants list in group chat window.')],
|
||||
'chat_merge_consecutive_nickname': [opt_bool, False, _('In a chat, show the nickname at the beginning of a line only when it\'s not the same person talking than in previous message.')],
|
||||
'chat_merge_consecutive_nickname_indent': [opt_str, ' ', _('Indentation when using merge consecutive nickname.')],
|
||||
'use_smooth_scrolling': [opt_bool, True, _('Smooth scroll message in conversation window')],
|
||||
'gc_nicknames_colors': [ opt_str, '#a34526:#c000ff:#0012ff:#388a99:#045723:#7c7c7c:#ff8a00:#94452d:#244b5a:#32645a', _('List of colors that will be used to color nicknames in group chats.'), True ],
|
||||
'ctrl_tab_go_to_next_composing': [opt_bool, True, _('Ctrl-Tab go to next composing tab when none is unread.')],
|
||||
'confirm_metacontacts': [ opt_str, '', _('Should we show the confirm metacontacts creation dialog or not? Empty string means we never show the dialog.')],
|
||||
|
@ -235,6 +256,8 @@ class Config:
|
|||
'subscribe_mood': [opt_bool, True],
|
||||
'subscribe_activity': [opt_bool, True],
|
||||
'subscribe_tune': [opt_bool, True],
|
||||
'attach_notifications_to_systray': [opt_bool, False, _('If True, notification windows from notification-daemon will be attached to systray icon.')],
|
||||
'use_pep': [opt_bool, False, 'temporary variable to enable pep support'],
|
||||
}
|
||||
|
||||
__options_per_key = {
|
||||
|
@ -257,14 +280,14 @@ class Config:
|
|||
'active': [ opt_bool, True],
|
||||
'proxy': [ opt_str, '', '', True ],
|
||||
'keyid': [ opt_str, '', '', True ],
|
||||
'gpg_sign_presence': [ opt_bool, True, _('If disabled, don\'t sign presences with GPG key, even if GPG is configured.') ],
|
||||
'keyname': [ opt_str, '', '', True ],
|
||||
'usessl': [ opt_bool, False, '', True ],
|
||||
'ssl_fingerprint_sha1': [ opt_str, '', '', True ],
|
||||
'use_srv': [ opt_bool, True, '', True ],
|
||||
'use_custom_host': [ opt_bool, False, '', True ],
|
||||
'custom_port': [ opt_int, 5222, '', True ],
|
||||
'custom_host': [ opt_str, '', '', True ],
|
||||
'savegpgpass': [ opt_bool, False, '', True ],
|
||||
'gpgpassword': [ opt_str, '' ],
|
||||
'sync_with_global_status': [ opt_bool, False, ],
|
||||
'no_log_for': [ opt_str, '' ],
|
||||
'minimized_gc': [ opt_str, '' ],
|
||||
|
|
|
@ -79,9 +79,9 @@ class ConfigPaths:
|
|||
|
||||
# LOG is deprecated
|
||||
k = ( 'LOG', 'LOG_DB', 'VCARD', 'AVATAR', 'MY_EMOTS',
|
||||
'MY_ICONSETS' )
|
||||
'MY_ICONSETS', 'MY_CACERTS')
|
||||
v = (u'logs', u'logs.db', u'vcards', u'avatars', u'emoticons',
|
||||
u'iconsets')
|
||||
u'iconsets', u'cacerts.pem')
|
||||
|
||||
if os.name == 'nt':
|
||||
v = map(lambda x: x.capitalize(), v)
|
||||
|
@ -102,16 +102,19 @@ class ConfigPaths:
|
|||
# for k, v in paths.iteritems():
|
||||
# print "%s: %s" % (repr(k), repr(v))
|
||||
|
||||
def init_profile(self, profile):
|
||||
def init_profile(self, profile = ''):
|
||||
conffile = windowsify(u'config')
|
||||
pidfile = windowsify(u'gajim')
|
||||
secretsfile = windowsify(u'secrets')
|
||||
|
||||
if len(profile) > 0:
|
||||
conffile += u'.' + profile
|
||||
pidfile += u'.' + profile
|
||||
secretsfile += u'.' + profile
|
||||
pidfile += u'.pid'
|
||||
self.add_from_root('CONFIG_FILE', conffile)
|
||||
self.add_from_root('PID_FILE', pidfile)
|
||||
self.add_from_root('SECRETS_FILE', secretsfile)
|
||||
|
||||
# for k, v in paths.iteritems():
|
||||
# print "%s: %s" % (repr(k), repr(v))
|
||||
|
|
|
@ -2,26 +2,34 @@
|
|||
##
|
||||
##
|
||||
## Copyright (C) 2003-2004 Vincent Hanquez <tab@snarc.org>
|
||||
## Copyright (C) 2003-2006 Yann Le Boulanger <asterix@lagaule.org>
|
||||
## Copyright (C) 2003-2007 Yann Leboulanger <asterix@lagaule.org>
|
||||
## Copyright (C) 2005-2006 Nikos Kouremenos <kourem@gmail.com>
|
||||
## Copyright (C) 2005-2006 Dimitur Kirov <dkirov@gmail.com>
|
||||
## Copyright (C) 2005-2006 Travis Shirk <travis@pobox.com>
|
||||
## Dimitur Kirov <dkirov@gmail.com>
|
||||
## Travis Shirk <travis@pobox.com>
|
||||
## Copyright (C) 2007 Julien Pivotto <roidelapluie@gmail.com>
|
||||
## Stephan Erb <steve-e@h3c.de>
|
||||
##
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## This file is part of Gajim.
|
||||
##
|
||||
## Gajim 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; version 2 only.
|
||||
## by the Free Software Foundation; version 3 only.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## Gajim 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 Gajim. If not, see <http://www.gnu.org/licenses/>.
|
||||
##
|
||||
|
||||
import os
|
||||
import random
|
||||
import socket
|
||||
|
||||
import time
|
||||
|
||||
try:
|
||||
randomsource = random.SystemRandom()
|
||||
except:
|
||||
|
@ -51,38 +59,38 @@ log = logging.getLogger('gajim.c.connection')
|
|||
import gtkgui_helpers
|
||||
|
||||
ssl_error = {
|
||||
2: "Unable to get issuer certificate",
|
||||
3: "Unable to get certificate CRL",
|
||||
4: "Unable to decrypt certificate's signature",
|
||||
5: "Unable to decrypt CRL's signature",
|
||||
6: "Unable to decode issuer public key",
|
||||
7: "Certificate signature failure",
|
||||
8: "CRL signature failure",
|
||||
9: "Certificate is not yet valid",
|
||||
10: "Certificate has expired",
|
||||
11: "CRL is not yet valid",
|
||||
12: "CRL has expired",
|
||||
13: "Format error in certificate's notBefore field",
|
||||
14: "Format error in certificate's notAfter field",
|
||||
15: "Format error in CRL's lastUpdate field",
|
||||
16: "Format error in CRL's nextUpdate field",
|
||||
17: "Out of memory",
|
||||
18: "Self signed certificate in certificate chain",
|
||||
19: "Unable to get local issuer certificate",
|
||||
20: "Unable to verify the first certificate",
|
||||
21: "Unable to verify the first certificate",
|
||||
22: "Certificate chain too long",
|
||||
23: "Certificate revoked",
|
||||
24: "Invalid CA certificate",
|
||||
25: "Path length constraint exceeded",
|
||||
26: "Unsupported certificate purpose",
|
||||
27: "Certificate not trusted",
|
||||
28: "Certificate rejected",
|
||||
29: "Subject issuer mismatch",
|
||||
30: "Authority and subject key identifier mismatch",
|
||||
31: "Authority and issuer serial number mismatch",
|
||||
32: "Key usage does not include certificate signing",
|
||||
50: "Application verification failure"
|
||||
2: _("Unable to get issuer certificate"),
|
||||
3: _("Unable to get certificate CRL"),
|
||||
4: _("Unable to decrypt certificate's signature"),
|
||||
5: _("Unable to decrypt CRL's signature"),
|
||||
6: _("Unable to decode issuer public key"),
|
||||
7: _("Certificate signature failure"),
|
||||
8: _("CRL signature failure"),
|
||||
9: _("Certificate is not yet valid"),
|
||||
10: _("Certificate has expired"),
|
||||
11: _("CRL is not yet valid"),
|
||||
12: _("CRL has expired"),
|
||||
13: _("Format error in certificate's notBefore field"),
|
||||
14: _("Format error in certificate's notAfter field"),
|
||||
15: _("Format error in CRL's lastUpdate field"),
|
||||
16: _("Format error in CRL's nextUpdate field"),
|
||||
17: _("Out of memory"),
|
||||
18: _("Self signed certificate in certificate chain"),
|
||||
19: _("Unable to get local issuer certificate"),
|
||||
20: _("Unable to verify the first certificate"),
|
||||
21: _("Unable to verify the first certificate"),
|
||||
22: _("Certificate chain too long"),
|
||||
23: _("Certificate revoked"),
|
||||
24: _("Invalid CA certificate"),
|
||||
25: _("Path length constraint exceeded"),
|
||||
26: _("Unsupported certificate purpose"),
|
||||
27: _("Certificate not trusted"),
|
||||
28: _("Certificate rejected"),
|
||||
29: _("Subject issuer mismatch"),
|
||||
30: _("Authority and subject key identifier mismatch"),
|
||||
31: _("Authority and issuer serial number mismatch"),
|
||||
32: _("Key usage does not include certificate signing"),
|
||||
50: _("Application verification failure")
|
||||
}
|
||||
class Connection(ConnectionHandlers):
|
||||
'''Connection class'''
|
||||
|
@ -99,6 +107,8 @@ class Connection(ConnectionHandlers):
|
|||
self.last_connection = None # last ClientCommon instance
|
||||
self.is_zeroconf = False
|
||||
self.gpg = None
|
||||
if USE_GPG:
|
||||
self.gpg = GnuPG.GnuPG(gajim.config.get('use_gpg_agent'))
|
||||
self.status = ''
|
||||
self.priority = gajim.get_priority(name, 'offline')
|
||||
self.old_show = ''
|
||||
|
@ -109,6 +119,7 @@ class Connection(ConnectionHandlers):
|
|||
self.time_to_reconnect = None
|
||||
self.last_time_to_reconnect = None
|
||||
self.new_account_info = None
|
||||
self.new_account_form = None
|
||||
self.bookmarks = []
|
||||
self.annotations = {}
|
||||
self.on_purpose = False
|
||||
|
@ -131,17 +142,12 @@ class Connection(ConnectionHandlers):
|
|||
self.blocked_contacts = []
|
||||
self.blocked_groups = []
|
||||
self.pep_supported = False
|
||||
# Do we continue connection when we get roster (send presence,get vcard...)
|
||||
# Do we continue connection when we get roster (send presence,get vcard..)
|
||||
self.continue_connect_info = None
|
||||
# To know the groupchat jid associated with a sranza ID. Useful to
|
||||
# request vcard or os info... to a real JID but act as if it comes from
|
||||
# the fake jid
|
||||
self.groupchat_jids = {} # {ID : groupchat_jid}
|
||||
if USE_GPG:
|
||||
self.gpg = GnuPG.GnuPG(gajim.config.get('use_gpg_agent'))
|
||||
gajim.config.set('usegpg', True)
|
||||
else:
|
||||
gajim.config.set('usegpg', False)
|
||||
|
||||
self.on_connect_success = None
|
||||
self.on_connect_failure = None
|
||||
|
@ -151,7 +157,7 @@ class Connection(ConnectionHandlers):
|
|||
self.available_transports = {} # list of available transports on this
|
||||
# server {'icq': ['icq.server.com', 'icq2.server.com'], }
|
||||
self.vcard_supported = True
|
||||
self.metacontacts_supported = True
|
||||
self.private_storage_supported = True
|
||||
# END __init__
|
||||
|
||||
def put_event(self, ev):
|
||||
|
@ -171,16 +177,15 @@ class Connection(ConnectionHandlers):
|
|||
self.connected = 1
|
||||
self.dispatch('STATUS', 'connecting')
|
||||
self.retrycount += 1
|
||||
signed = self.get_signed_msg(self.status)
|
||||
self.on_connect_auth = self._init_roster
|
||||
self.connect_and_init(self.old_show, self.status, signed)
|
||||
self.connect_and_init(self.old_show, self.status, self.gpg != None)
|
||||
else:
|
||||
# reconnect succeeded
|
||||
self.time_to_reconnect = None
|
||||
self.retrycount = 0
|
||||
|
||||
# We are doing disconnect at so many places, better use one function in all
|
||||
def disconnect(self, on_purpose = False):
|
||||
def disconnect(self, on_purpose=False):
|
||||
#FIXME: set the Tune to None before disconnection per account
|
||||
#gajim.interface.roster._music_track_changed(None, None)
|
||||
self.on_purpose = on_purpose
|
||||
|
@ -202,8 +207,8 @@ class Connection(ConnectionHandlers):
|
|||
# after we auth to server
|
||||
self.old_show = STATUS_LIST[self.connected]
|
||||
self.connected = 0
|
||||
self.dispatch('STATUS', 'offline')
|
||||
if not self.on_purpose:
|
||||
self.dispatch('STATUS', 'offline')
|
||||
self.disconnect()
|
||||
if gajim.config.get_per('accounts', self.name, 'autoreconnect'):
|
||||
self.connected = -1
|
||||
|
@ -257,7 +262,63 @@ class Connection(ConnectionHandlers):
|
|||
return
|
||||
is_form = data[2]
|
||||
conf = data[1]
|
||||
self.dispatch('NEW_ACC_CONNECTED', (conf, is_form))
|
||||
if self.new_account_form:
|
||||
def _on_register_result(result):
|
||||
if not common.xmpp.isResultNode(result):
|
||||
self.dispatch('ACC_NOT_OK', (result.getError()))
|
||||
return
|
||||
if USE_GPG:
|
||||
self.gpg = GnuPG.GnuPG(gajim.config.get(
|
||||
'use_gpg_agent'))
|
||||
self.dispatch('ACC_OK', (self.new_account_info))
|
||||
self.new_account_info = None
|
||||
self.new_account_form = None
|
||||
if self.connection:
|
||||
self.connection.UnregisterDisconnectHandler(
|
||||
self._on_new_account)
|
||||
self.disconnect(on_purpose=True)
|
||||
# it's the second time we get the form, we have info user
|
||||
# typed, so send them
|
||||
if is_form:
|
||||
#TODO: Check if form has changed
|
||||
iq = common.xmpp.Iq('set', common.xmpp.NS_REGISTER, to=self._hostname)
|
||||
iq.setTag('query').addChild(node=self.new_account_form)
|
||||
self.connection.SendAndCallForResponse(iq,
|
||||
_on_register_result)
|
||||
else:
|
||||
if self.new_account_form.keys().sort() != \
|
||||
conf.keys().sort():
|
||||
# requested config has changed since first connection
|
||||
self.dispatch('ACC_NOT_OK', (_(
|
||||
'Server %s provided a different registration form')\
|
||||
% data[0]))
|
||||
return
|
||||
common.xmpp.features_nb.register(self.connection,
|
||||
self._hostname, self.new_account_form,
|
||||
_on_register_result)
|
||||
return
|
||||
try:
|
||||
errnum = self.connection.Connection.ssl_errnum
|
||||
except AttributeError:
|
||||
errnum = -1 # we don't have an errnum
|
||||
ssl_msg = ''
|
||||
if errnum > 0:
|
||||
if errnum in ssl_error:
|
||||
ssl_msg = ssl_error[errnum]
|
||||
else:
|
||||
ssl_msg = _('Unknown SSL error: %d') % errnum
|
||||
ssl_cert = ''
|
||||
if hasattr(self.connection.Connection, 'ssl_cert_pem'):
|
||||
ssl_cert = self.connection.Connection.ssl_cert_pem
|
||||
ssl_fingerprint = ''
|
||||
if hasattr(self.connection.Connection, 'ssl_fingerprint_sha1'):
|
||||
ssl_fingerprint = \
|
||||
self.connection.Connection.ssl_fingerprint_sha1
|
||||
self.dispatch('NEW_ACC_CONNECTED', (conf, is_form, ssl_msg,
|
||||
ssl_cert, ssl_fingerprint))
|
||||
self.connection.UnregisterDisconnectHandler(
|
||||
self._on_new_account)
|
||||
self.disconnect(on_purpose=True)
|
||||
return
|
||||
if not data[1]: # wrong answer
|
||||
self.dispatch('ERROR', (_('Invalid answer'),
|
||||
|
@ -477,7 +538,6 @@ class Connection(ConnectionHandlers):
|
|||
con.RegisterDisconnectHandler(self._disconnectedReconnCB)
|
||||
log.debug(_('Connected to server %s:%s with %s') % (self._current_host['host'],
|
||||
self._current_host['port'], con_type))
|
||||
self._register_handlers(con, con_type)
|
||||
|
||||
name = gajim.config.get_per('accounts', self.name, 'name')
|
||||
hostname = gajim.config.get_per('accounts', self.name, 'hostname')
|
||||
|
@ -487,14 +547,31 @@ class Connection(ConnectionHandlers):
|
|||
except AttributeError:
|
||||
errnum = -1 # we don't have an errnum
|
||||
if errnum > 0:
|
||||
# FIXME: tell the user that the certificat is untrusted, and ask him what to do
|
||||
try:
|
||||
log.warning("The authenticity of the "+hostname+" certificate could be unvalid.\nSSL Error: "+ssl_error[errnum])
|
||||
except KeyError:
|
||||
log.warning("Unknown SSL error: %d" % errnum)
|
||||
text = _('The authenticity of the %s certificate could be invalid.') %\
|
||||
hostname
|
||||
if errnum in ssl_error:
|
||||
text += _('\nSSL Error: %s') % ssl_error[errnum]
|
||||
else:
|
||||
text += _('\nUnknown SSL error: %d') % errnum
|
||||
self.dispatch('SSL_ERROR', (text, con.Connection.ssl_cert_pem,
|
||||
con.Connection.ssl_fingerprint_sha1))
|
||||
return True
|
||||
if hasattr(con.Connection, 'ssl_fingerprint_sha1'):
|
||||
saved_fingerprint = gajim.config.get_per('accounts', self.name, 'ssl_fingerprint_sha1')
|
||||
if saved_fingerprint:
|
||||
# Check sha1 fingerprint
|
||||
if con.Connection.ssl_fingerprint_sha1 != saved_fingerprint:
|
||||
self.dispatch('FINGERPRINT_ERROR',
|
||||
(con.Connection.ssl_fingerprint_sha1,))
|
||||
return True
|
||||
self._register_handlers(con, con_type)
|
||||
con.auth(name, self.password, self.server_resource, 1, self.__on_auth)
|
||||
|
||||
return True
|
||||
|
||||
def ssl_certificate_accepted(self):
|
||||
name = gajim.config.get_per('accounts', self.name, 'name')
|
||||
self._register_handlers(self.connection, 'ssl')
|
||||
self.connection.auth(name, self.password, self.server_resource, 1, self.__on_auth)
|
||||
|
||||
def _register_handlers(self, con, con_type):
|
||||
self.peerhost = con.get_peerhost()
|
||||
|
@ -528,13 +605,13 @@ class Connection(ConnectionHandlers):
|
|||
self.on_connect_auth(con)
|
||||
self.on_connect_auth = None
|
||||
else:
|
||||
# Forget password if needed
|
||||
if not gajim.config.get_per('accounts', self.name, 'savepass'):
|
||||
# Forget password, it's wrong
|
||||
self.password = None
|
||||
gajim.log.debug("Couldn't authenticate to %s" % self._hostname)
|
||||
self.disconnect(on_purpose = True)
|
||||
self.dispatch('STATUS', 'offline')
|
||||
self.dispatch('ERROR', (_('Authentication failed with "%s"') % self._hostname,
|
||||
self.dispatch('ERROR', (_('Authentication failed with "%s"') % \
|
||||
self._hostname,
|
||||
_('Please check your login and password for correctness.')))
|
||||
if self.on_connect_auth:
|
||||
self.on_connect_auth(None)
|
||||
|
@ -543,7 +620,7 @@ class Connection(ConnectionHandlers):
|
|||
|
||||
def quit(self, kill_core):
|
||||
if kill_core and gajim.account_is_connected(self.name):
|
||||
self.disconnect(on_purpose = True)
|
||||
self.disconnect(on_purpose=True)
|
||||
|
||||
def get_privacy_lists(self):
|
||||
if not self.connection:
|
||||
|
@ -665,28 +742,36 @@ class Connection(ConnectionHandlers):
|
|||
self.dispatch('SIGNED_IN', ())
|
||||
|
||||
def test_gpg_passphrase(self, password):
|
||||
if not self.gpg:
|
||||
return False
|
||||
self.gpg.passphrase = password
|
||||
keyID = gajim.config.get_per('accounts', self.name, 'keyid')
|
||||
signed = self.gpg.sign('test', keyID)
|
||||
self.gpg.password = None
|
||||
return signed != 'BAD_PASSPHRASE'
|
||||
|
||||
def get_signed_msg(self, msg):
|
||||
def get_signed_presence(self, msg, callback = None):
|
||||
if gajim.config.get_per('accounts', self.name, 'gpg_sign_presence'):
|
||||
return self.get_signed_msg(msg, callback)
|
||||
return ''
|
||||
|
||||
def get_signed_msg(self, msg, callback = None):
|
||||
'''returns the signed message if possible
|
||||
or an empty string if gpg is not used
|
||||
or None if waiting for passphrase.
|
||||
callback is the function to call when user give the passphrase'''
|
||||
signed = ''
|
||||
keyID = gajim.config.get_per('accounts', self.name, 'keyid')
|
||||
if keyID and USE_GPG:
|
||||
if keyID and self.gpg:
|
||||
use_gpg_agent = gajim.config.get('use_gpg_agent')
|
||||
if self.connected < 2 and self.gpg.passphrase is None and \
|
||||
not use_gpg_agent:
|
||||
if self.gpg.passphrase is None and not use_gpg_agent:
|
||||
# We didn't set a passphrase
|
||||
self.dispatch('ERROR', (_('OpenPGP passphrase was not given'),
|
||||
#%s is the account name here
|
||||
_('You will be connected to %s without OpenPGP.') % self.name))
|
||||
elif self.gpg.passphrase is not None or use_gpg_agent:
|
||||
return None
|
||||
if self.gpg.passphrase is not None or use_gpg_agent:
|
||||
signed = self.gpg.sign(msg, keyID)
|
||||
if signed == 'BAD_PASSPHRASE':
|
||||
self.gpg = None
|
||||
signed = ''
|
||||
if self.connected < 2:
|
||||
self.dispatch('BAD_PASSPHRASE', ())
|
||||
return signed
|
||||
|
||||
|
@ -695,15 +780,16 @@ class Connection(ConnectionHandlers):
|
|||
self.on_connect_failure = self._connect_failure
|
||||
self.connect()
|
||||
|
||||
def connect_and_init(self, show, msg, signed):
|
||||
self.continue_connect_info = [show, msg, signed]
|
||||
def connect_and_init(self, show, msg, sign_msg):
|
||||
self.continue_connect_info = [show, msg, sign_msg]
|
||||
self.on_connect_auth = self._init_roster
|
||||
self.connect_and_auth()
|
||||
|
||||
def _init_roster(self, con):
|
||||
self.connection = con
|
||||
if self.connection:
|
||||
con.set_send_timeout(self.keepalives, self.send_keepalive)
|
||||
if not self.connection:
|
||||
return
|
||||
self.connection.set_send_timeout(self.keepalives, self.send_keepalive)
|
||||
self.connection.onreceive(None)
|
||||
iq = common.xmpp.Iq('get', common.xmpp.NS_PRIVACY, xmlns = '')
|
||||
id = self.connection.getAnID()
|
||||
|
@ -726,7 +812,7 @@ class Connection(ConnectionHandlers):
|
|||
if msg:
|
||||
p.setStatus(msg)
|
||||
else:
|
||||
signed = self.get_signed_msg(msg)
|
||||
signed = self.get_signed_presence(msg)
|
||||
priority = unicode(gajim.get_priority(self.name, sshow))
|
||||
p = common.xmpp.Presence(typ = None, priority = priority, show = sshow,
|
||||
to = jid)
|
||||
|
@ -744,9 +830,9 @@ class Connection(ConnectionHandlers):
|
|||
if not msg:
|
||||
msg = ''
|
||||
keyID = gajim.config.get_per('accounts', self.name, 'keyid')
|
||||
signed = ''
|
||||
sign_msg = False
|
||||
if not auto and not show == 'offline':
|
||||
signed = self.get_signed_msg(msg)
|
||||
sign_msg = True
|
||||
self.status = msg
|
||||
if show != 'offline' and not self.connected:
|
||||
# set old_show to requested 'show' in case we need to
|
||||
|
@ -761,7 +847,9 @@ class Connection(ConnectionHandlers):
|
|||
safe_substitute({
|
||||
'hostname': socket.gethostname()
|
||||
})
|
||||
self.connect_and_init(show, msg, signed)
|
||||
if USE_GPG:
|
||||
self.gpg = GnuPG.GnuPG(gajim.config.get('use_gpg_agent'))
|
||||
self.connect_and_init(show, msg, sign_msg)
|
||||
|
||||
elif show == 'offline':
|
||||
self.connected = 0
|
||||
|
@ -785,6 +873,7 @@ class Connection(ConnectionHandlers):
|
|||
was_invisible = self.connected == STATUS_LIST.index('invisible')
|
||||
self.connected = STATUS_LIST.index(show)
|
||||
if show == 'invisible':
|
||||
signed = self.get_signed_presence(msg)
|
||||
self.send_invisible_presence(msg, signed)
|
||||
return
|
||||
if was_invisible and self.privacy_rules_supported:
|
||||
|
@ -796,6 +885,7 @@ class Connection(ConnectionHandlers):
|
|||
p = self.add_sha(p)
|
||||
if msg:
|
||||
p.setStatus(msg)
|
||||
signed = self.get_signed_presence(msg)
|
||||
if signed:
|
||||
p.setTag(common.xmpp.NS_SIGNED + ' x').setData(signed)
|
||||
if self.connection:
|
||||
|
@ -820,21 +910,21 @@ class Connection(ConnectionHandlers):
|
|||
|
||||
self.connection.send(msg_iq)
|
||||
|
||||
def send_message(self, jid, msg, keyID, type = 'chat', subject='',
|
||||
chatstate = None, msg_id = None, composing_xep = None, resource = None,
|
||||
user_nick = None, xhtml = None, forward_from = None):
|
||||
def send_message(self, jid, msg, keyID, type='chat', subject='',
|
||||
chatstate=None, msg_id=None, composing_xep=None, resource=None,
|
||||
user_nick=None, xhtml=None, session=None, forward_from=None, form_node=None):
|
||||
if not self.connection:
|
||||
return 1
|
||||
if msg and not xhtml and gajim.config.get('rst_formatting_outgoing_messages'):
|
||||
xhtml = create_xhtml(msg)
|
||||
if not msg and chatstate is None:
|
||||
if not msg and chatstate is None and form_node is None:
|
||||
return 2
|
||||
fjid = jid
|
||||
if resource:
|
||||
fjid += '/' + resource
|
||||
msgtxt = msg
|
||||
msgenc = ''
|
||||
if keyID and USE_GPG:
|
||||
if keyID and self.gpg:
|
||||
#encrypt
|
||||
msgenc, error = self.gpg.encrypt(msg, [keyID])
|
||||
if msgenc and not error:
|
||||
|
@ -866,12 +956,15 @@ class Connection(ConnectionHandlers):
|
|||
if msgenc:
|
||||
msg_iq.setTag(common.xmpp.NS_ENCRYPTED + ' x').setData(msgenc)
|
||||
|
||||
if form_node:
|
||||
msg_iq.addChild(node=form_node)
|
||||
|
||||
# JEP-0172: user_nickname
|
||||
if user_nick:
|
||||
msg_iq.setTag('nick', namespace = common.xmpp.NS_NICK).setData(
|
||||
user_nick)
|
||||
|
||||
# chatstates - if peer supports jep85 or jep22, send chatstates
|
||||
# chatstates - if peer supports xep85 or xep22, send chatstates
|
||||
# please note that the only valid tag inside a message containing a <body>
|
||||
# tag is the active event
|
||||
if chatstate is not None:
|
||||
|
@ -896,8 +989,17 @@ class Connection(ConnectionHandlers):
|
|||
namespace=common.xmpp.NS_ADDRESS)
|
||||
addresses.addChild('address', attrs = {'type': 'ofrom',
|
||||
'jid': forward_from})
|
||||
if session:
|
||||
# XEP-0201
|
||||
session.last_send = time.time()
|
||||
msg_iq.setThread(session.thread_id)
|
||||
|
||||
# XEP-0200
|
||||
if session.enable_encryption:
|
||||
msg_iq = session.encrypt_stanza(msg_iq)
|
||||
|
||||
self.connection.send(msg_iq)
|
||||
if not forward_from:
|
||||
if not forward_from and session.is_loggable():
|
||||
no_log_for = gajim.config.get_per('accounts', self.name, 'no_log_for')\
|
||||
.split()
|
||||
ji = gajim.get_jid_without_resource(jid)
|
||||
|
@ -1007,21 +1109,6 @@ class Connection(ConnectionHandlers):
|
|||
groups = groups)
|
||||
|
||||
def send_new_account_infos(self, form, is_form):
|
||||
def _on_register_result(result):
|
||||
if not common.xmpp.isResultNode(result):
|
||||
self.dispatch('ACC_NOT_OK', (result.getError()))
|
||||
return
|
||||
if USE_GPG:
|
||||
self.gpg = GnuPG.GnuPG(gajim.config.get('use_gpg_agent'))
|
||||
gajim.config.set('usegpg', True)
|
||||
else:
|
||||
gajim.config.set('usegpg', False)
|
||||
gajim.connections[self.name] = self
|
||||
self.dispatch('ACC_OK', (self.new_account_info))
|
||||
self.new_account_info = None
|
||||
if self.connection:
|
||||
self.connection.UnregisterDisconnectHandler(self._on_new_account)
|
||||
self.disconnect(on_purpose=True)
|
||||
if is_form:
|
||||
# Get username and password and put them in new_account_info
|
||||
for field in self._data_form.iter_fields():
|
||||
|
@ -1029,17 +1116,14 @@ class Connection(ConnectionHandlers):
|
|||
self.new_account_info['name'] = field.value
|
||||
if field.var == 'password':
|
||||
self.new_account_info['password'] = field.value
|
||||
iq=Iq('set', NS_REGISTER, to = self._hostname)
|
||||
iq.setTag('query').addChild(node = form)
|
||||
self.connection.SendAndCallForResponse(iq, _on_register_result)
|
||||
else:
|
||||
# Get username and password and put them in new_account_info
|
||||
if form.has_key('username'):
|
||||
self.new_account_info['name'] = form['username']
|
||||
if form.has_key('password'):
|
||||
self.new_account_info['password'] = form['password']
|
||||
common.xmpp.features_nb.register(self.connection, self._hostname,
|
||||
form, _on_register_result)
|
||||
self.new_account_form = form
|
||||
self.new_account(self.name, self.new_account_info)
|
||||
|
||||
def new_account(self, name, config, sync = False):
|
||||
# If a connection already exist we cannot create a new account
|
||||
|
@ -1204,6 +1288,20 @@ class Connection(ConnectionHandlers):
|
|||
p = self.add_sha(p, ptype != 'unavailable')
|
||||
self.connection.send(p)
|
||||
|
||||
def check_unique_room_id_support(self, server, instance):
|
||||
if not self.connection:
|
||||
return
|
||||
iq = common.xmpp.Iq(typ = 'get', to = server)
|
||||
iq.setAttr('id', 'unique1')
|
||||
iq.addChild('unique', namespace=common.xmpp.NS_MUC_UNIQUE)
|
||||
def _on_response(resp):
|
||||
if not common.xmpp.isResultNode(resp):
|
||||
self.dispatch('UNIQUE_ROOM_ID_UNSUPPORTED', (server, instance))
|
||||
return
|
||||
self.dispatch('UNIQUE_ROOM_ID_SUPPORTED', (server, instance,
|
||||
resp.getTag('unique').getData()))
|
||||
self.connection.SendAndCallForResponse(iq, _on_response)
|
||||
|
||||
def join_gc(self, nick, room_jid, password):
|
||||
# FIXME: This room JID needs to be normalized; see #1364
|
||||
if not self.connection:
|
||||
|
@ -1224,6 +1322,11 @@ class Connection(ConnectionHandlers):
|
|||
# last date/time in history to avoid duplicate
|
||||
if not self.last_history_line.has_key(room_jid):
|
||||
# Not in memory, get it from DB
|
||||
last_log = None
|
||||
no_log_for = gajim.config.get_per('accounts', self.name, 'no_log_for')\
|
||||
.split()
|
||||
if self.name not in no_log_for and room_jid not in no_log_for:
|
||||
# Do not check if we are not logging for this room
|
||||
last_log = gajim.logger.get_last_date_that_has_logs(room_jid,
|
||||
is_room = True)
|
||||
if last_log is None:
|
||||
|
@ -1341,7 +1444,7 @@ class Connection(ConnectionHandlers):
|
|||
self.connection.send(iq)
|
||||
|
||||
def gpg_passphrase(self, passphrase):
|
||||
if USE_GPG:
|
||||
if self.gpg:
|
||||
use_gpg_agent = gajim.config.get('use_gpg_agent')
|
||||
if use_gpg_agent:
|
||||
self.gpg.passphrase = None
|
||||
|
@ -1349,13 +1452,13 @@ class Connection(ConnectionHandlers):
|
|||
self.gpg.passphrase = passphrase
|
||||
|
||||
def ask_gpg_keys(self):
|
||||
if USE_GPG:
|
||||
if self.gpg:
|
||||
keys = self.gpg.get_keys()
|
||||
return keys
|
||||
return None
|
||||
|
||||
def ask_gpg_secrete_keys(self):
|
||||
if USE_GPG:
|
||||
if self.gpg:
|
||||
keys = self.gpg.get_secret_keys()
|
||||
return keys
|
||||
return None
|
||||
|
@ -1390,11 +1493,13 @@ class Connection(ConnectionHandlers):
|
|||
else:
|
||||
_on_unregister_account_connect(self.connection)
|
||||
|
||||
def send_invite(self, room, to, reason=''):
|
||||
def send_invite(self, room, to, reason='', continue_tag=False):
|
||||
'''sends invitation'''
|
||||
message=common.xmpp.Message(to = room)
|
||||
c = message.addChild(name = 'x', namespace = common.xmpp.NS_MUC_USER)
|
||||
c = c.addChild(name = 'invite', attrs={'to' : to})
|
||||
if continue_tag:
|
||||
c.addChild(name = 'continue')
|
||||
if reason != '':
|
||||
c.setTagData('reason', reason)
|
||||
self.connection.send(message)
|
||||
|
|
|
@ -2,20 +2,25 @@
|
|||
## Copyright (C) 2006 Gajim Team
|
||||
##
|
||||
## Contributors for this file:
|
||||
## - Yann Le Boulanger <asterix@lagaule.org>
|
||||
## - Yann Leboulanger <asterix@lagaule.org>
|
||||
## - Nikos Kouremenos <kourem@gmail.com>
|
||||
## - Dimitur Kirov <dkirov@gmail.com>
|
||||
## - Travis Shirk <travis@pobox.com>
|
||||
##
|
||||
## 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; version 2 only.
|
||||
## This file is part of Gajim.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## Gajim 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; version 3 only.
|
||||
##
|
||||
## Gajim 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 Gajim. If not, see <http://www.gnu.org/licenses/>.
|
||||
##
|
||||
|
||||
import os
|
||||
import base64
|
||||
|
@ -45,6 +50,8 @@ if dbus_support.supported:
|
|||
import dbus
|
||||
from music_track_listener import MusicTrackListener
|
||||
|
||||
from common.stanza_session import EncryptedStanzaSession
|
||||
|
||||
STATUS_LIST = ['offline', 'connecting', 'online', 'chat', 'away', 'xa', 'dnd',
|
||||
'invisible', 'error']
|
||||
# kind of events we can wait for an answer
|
||||
|
@ -65,7 +72,7 @@ class ConnectionBytestream:
|
|||
def __init__(self):
|
||||
self.files_props = {}
|
||||
|
||||
def is_transfer_stoped(self, file_props):
|
||||
def is_transfer_stopped(self, file_props):
|
||||
if file_props.has_key('error') and file_props['error'] != 0:
|
||||
return True
|
||||
if file_props.has_key('completed') and file_props['completed']:
|
||||
|
@ -94,7 +101,7 @@ class ConnectionBytestream:
|
|||
def remove_transfers_for_contact(self, contact):
|
||||
''' stop all active transfer for contact '''
|
||||
for file_props in self.files_props.values():
|
||||
if self.is_transfer_stoped(file_props):
|
||||
if self.is_transfer_stopped(file_props):
|
||||
continue
|
||||
receiver_jid = unicode(file_props['receiver']).split('/')[0]
|
||||
if contact.jid == receiver_jid:
|
||||
|
@ -182,11 +189,7 @@ class ConnectionBytestream:
|
|||
ft_add_hosts_to_send = map(lambda e:e.strip(),
|
||||
ft_add_hosts_to_send.split(','))
|
||||
for ft_host in ft_add_hosts_to_send:
|
||||
try:
|
||||
ft_host = socket.gethostbyname(ft_host)
|
||||
ft_add_hosts.append(ft_host)
|
||||
except socket.gaierror:
|
||||
self.dispatch('ERROR', (_('Wrong host'), _('The host %s you configured as the ft_add_hosts_to_send advanced option is not valid, so ignored.') % ft_host))
|
||||
listener = gajim.socks5queue.start_listener(port,
|
||||
sha_str, self._result_socks5_sid, file_props['sid'])
|
||||
if listener == None:
|
||||
|
@ -212,7 +215,6 @@ class ConnectionBytestream:
|
|||
ostreamhost.setAttr('port', unicode(port))
|
||||
ostreamhost.setAttr('host', ft_host)
|
||||
ostreamhost.setAttr('jid', sender)
|
||||
for thehost in self.peerhost:
|
||||
try:
|
||||
thehost = self.peerhost[0]
|
||||
streamhost = common.xmpp.Node(tag = 'streamhost') # My IP
|
||||
|
@ -473,6 +475,9 @@ class ConnectionBytestream:
|
|||
raise common.xmpp.NodeProcessed
|
||||
|
||||
if real_id[:3] == 'au_':
|
||||
if file.has_key('stopped') and file_props['stopped']:
|
||||
self.remove_transfer(file_props)
|
||||
else:
|
||||
gajim.socks5queue.send_file(file_props, self.name)
|
||||
raise common.xmpp.NodeProcessed
|
||||
|
||||
|
@ -494,6 +499,9 @@ class ConnectionBytestream:
|
|||
gajim.socks5queue.on_success = self._proxy_auth_ok
|
||||
raise common.xmpp.NodeProcessed
|
||||
|
||||
else:
|
||||
if file_props.has_key('stopped') and file_props['stopped']:
|
||||
self.remove_transfer(file_props)
|
||||
else:
|
||||
gajim.socks5queue.send_file(file_props, self.name)
|
||||
if file_props.has_key('fast'):
|
||||
|
@ -657,7 +665,8 @@ class ConnectionDisco:
|
|||
common.xmpp.NS_DISCO, frm = to)
|
||||
iq.setAttr('id', id)
|
||||
query = iq.setTag('query')
|
||||
query.setAttr('node','http://gajim.org/caps#' + gajim.version)
|
||||
query.setAttr('node','http://gajim.org/caps#' + gajim.version.split('-',
|
||||
1)[0])
|
||||
for f in (common.xmpp.NS_BYTESTREAM, common.xmpp.NS_SI, \
|
||||
common.xmpp.NS_FILE, common.xmpp.NS_COMMANDS):
|
||||
feature = common.xmpp.Node('feature')
|
||||
|
@ -709,6 +718,8 @@ class ConnectionDisco:
|
|||
|
||||
def _DiscoverItemsGetCB(self, con, iq_obj):
|
||||
gajim.log.debug('DiscoverItemsGetCB')
|
||||
if self.commandItemsQuery(con, iq_obj):
|
||||
raise common.xmpp.NodeProcessed
|
||||
node = iq_obj.getTagAttr('query', 'node')
|
||||
if node is None:
|
||||
result = iq_obj.buildReply('result')
|
||||
|
@ -723,7 +734,7 @@ class ConnectionDisco:
|
|||
q = iq_obj.getTag('query')
|
||||
node = q.getAttr('node')
|
||||
|
||||
if self.commandQuery(con, iq_obj):
|
||||
if self.commandInfoQuery(con, iq_obj):
|
||||
raise common.xmpp.NodeProcessed
|
||||
|
||||
else:
|
||||
|
@ -736,7 +747,8 @@ class ConnectionDisco:
|
|||
extension = None
|
||||
if node and node.find('#') != -1:
|
||||
extension = node[node.index('#') + 1:]
|
||||
client_version = 'http://gajim.org/caps#' + gajim.version
|
||||
client_version = 'http://gajim.org/caps#' + gajim.version.split('-',
|
||||
1)[0]
|
||||
|
||||
if node in (None, client_version):
|
||||
q.addChild('feature', attrs = {'var': common.xmpp.NS_BYTESTREAM})
|
||||
|
@ -745,12 +757,14 @@ class ConnectionDisco:
|
|||
q.addChild('feature', attrs = {'var': common.xmpp.NS_MUC})
|
||||
q.addChild('feature', attrs = {'var': common.xmpp.NS_COMMANDS})
|
||||
q.addChild('feature', attrs = {'var': common.xmpp.NS_DISCO_INFO})
|
||||
if gajim.config.get('use_pep'):
|
||||
q.addChild('feature', attrs = {'var': common.xmpp.NS_ACTIVITY})
|
||||
q.addChild('feature', attrs = {'var': common.xmpp.NS_ACTIVITY + '+notify'})
|
||||
q.addChild('feature', attrs = {'var': common.xmpp.NS_TUNE})
|
||||
q.addChild('feature', attrs = {'var': common.xmpp.NS_TUNE + '+notify'})
|
||||
q.addChild('feature', attrs = {'var': common.xmpp.NS_MOOD})
|
||||
q.addChild('feature', attrs = {'var': common.xmpp.NS_MOOD + '+notify'})
|
||||
q.addChild('feature', attrs = {'var': common.xmpp.NS_ESESSION_INIT})
|
||||
|
||||
if (node is None or extension == 'cstates') and gajim.config.get('outgoing_chat_state_notifactions') != 'disabled':
|
||||
q.addChild('feature', attrs = {'var': common.xmpp.NS_CHATSTATES})
|
||||
|
@ -868,7 +882,7 @@ class ConnectionVcard:
|
|||
|
||||
if len(ext):
|
||||
c.setAttr('ext', ' '.join(ext))
|
||||
c.setAttr('ver', gajim.version)
|
||||
c.setAttr('ver', gajim.version.split('-', 1)[0])
|
||||
return p
|
||||
|
||||
def node_to_dict(self, node):
|
||||
|
@ -1082,6 +1096,10 @@ class ConnectionVcard:
|
|||
tag = meta.getAttr('tag')
|
||||
data = {'jid': jid}
|
||||
order = meta.getAttr('order')
|
||||
try:
|
||||
order = int(order)
|
||||
except:
|
||||
order = 0
|
||||
if order != None:
|
||||
data['order'] = order
|
||||
if meta_list.has_key(tag):
|
||||
|
@ -1090,7 +1108,8 @@ class ConnectionVcard:
|
|||
meta_list[tag] = [data]
|
||||
self.dispatch('METACONTACTS', meta_list)
|
||||
else:
|
||||
self.metacontacts_supported = False
|
||||
if iq_obj.getErrorCode() not in ('403', '406', '404'):
|
||||
self.private_storage_supported = False
|
||||
# We can now continue connection by requesting the roster
|
||||
self.connection.initRoster()
|
||||
elif self.awaiting_answers[id][0] == PRIVACY_ARRIVED:
|
||||
|
@ -1207,7 +1226,7 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
|
|||
ConnectionBytestream.__init__(self)
|
||||
ConnectionCommands.__init__(self)
|
||||
ConnectionPubSub.__init__(self)
|
||||
self.gmail_url=None
|
||||
self.gmail_url = None
|
||||
# List of IDs we are waiting answers for {id: (type_of_request, data), }
|
||||
self.awaiting_answers = {}
|
||||
# List of IDs that will produce a timeout is answer doesn't arrive
|
||||
|
@ -1219,6 +1238,9 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
|
|||
# keep the latest subscribed event for each jid to prevent loop when we
|
||||
# acknoledge presences
|
||||
self.subscribed_events = {}
|
||||
|
||||
# keep track of sessions this connection has with other JIDs
|
||||
self.sessions = {}
|
||||
try:
|
||||
idle.init()
|
||||
except:
|
||||
|
@ -1245,6 +1267,33 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
|
|||
self.dispatch('HTTP_AUTH', (method, url, id, iq_obj, msg));
|
||||
raise common.xmpp.NodeProcessed
|
||||
|
||||
def _FeatureNegCB(self, con, stanza, session):
|
||||
gajim.log.debug('FeatureNegCB')
|
||||
feature = stanza.getTag(name='feature', namespace=common.xmpp.NS_FEATURE)
|
||||
form = common.xmpp.DataForm(node=feature.getTag('x'))
|
||||
|
||||
if form['FORM_TYPE'] == 'urn:xmpp:ssn':
|
||||
self.dispatch('SESSION_NEG', (stanza.getFrom(), session, form))
|
||||
else:
|
||||
reply = stanza.buildReply()
|
||||
reply.setType('error')
|
||||
|
||||
reply.addChild(feature)
|
||||
reply.addChild(node=xmpp.ErrorNode('service-unavailable', typ='cancel'))
|
||||
|
||||
con.send(reply)
|
||||
|
||||
raise common.xmpp.NodeProcessed
|
||||
|
||||
def _InitE2ECB(self, con, stanza, session):
|
||||
gajim.log.debug('InitE2ECB')
|
||||
init = stanza.getTag(name='init', namespace=common.xmpp.NS_ESESSION_INIT)
|
||||
form = common.xmpp.DataForm(node=init.getTag('x'))
|
||||
|
||||
self.dispatch('SESSION_NEG', (stanza.getFrom(), session, form))
|
||||
|
||||
raise common.xmpp.NodeProcessed
|
||||
|
||||
def _ErrorCB(self, con, iq_obj):
|
||||
gajim.log.debug('ErrorCB')
|
||||
if iq_obj.getQueryNS() == common.xmpp.NS_VERSION:
|
||||
|
@ -1313,7 +1362,7 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
|
|||
if storage_tag:
|
||||
ns = storage_tag.getNamespace()
|
||||
if ns == 'storage:metacontacts':
|
||||
self.metacontacts_supported = False
|
||||
self.private_storage_supported = False
|
||||
# Private XML Storage (XEP49) is not supported by server
|
||||
# Continue connecting
|
||||
self.connection.initRoster()
|
||||
|
@ -1399,7 +1448,8 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
|
|||
qp = iq_obj.getTag('query')
|
||||
qp.setTagData('utc', strftime('%Y%m%dT%T', gmtime()))
|
||||
qp.setTagData('tz', tzname[daylight])
|
||||
qp.setTagData('display', strftime('%c', localtime()))
|
||||
qp.setTagData('display', helpers.decode_string(strftime('%c',
|
||||
localtime())))
|
||||
self.connection.send(iq_obj)
|
||||
raise common.xmpp.NodeProcessed
|
||||
|
||||
|
@ -1460,6 +1510,19 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
|
|||
|
||||
def _messageCB(self, con, msg):
|
||||
'''Called when we receive a message'''
|
||||
frm = helpers.get_full_jid_from_iq(msg)
|
||||
mtype = msg.getType()
|
||||
thread_id = msg.getThread()
|
||||
|
||||
if not mtype:
|
||||
mtype = 'normal'
|
||||
|
||||
if not mtype == 'groupchat':
|
||||
session = self.get_session(frm, thread_id, mtype)
|
||||
|
||||
if thread_id and not session.received_thread_id:
|
||||
session.received_thread_id = True
|
||||
|
||||
# check if the message is pubsub#event
|
||||
if msg.getTag('event') is not None:
|
||||
self._pubsubEventCB(con, msg)
|
||||
|
@ -1469,9 +1532,31 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
|
|||
common.xmpp.NS_HTTP_AUTH:
|
||||
self._HttpAuthCB(con, msg)
|
||||
return
|
||||
if msg.getTag('feature') and msg.getTag('feature').namespace == \
|
||||
common.xmpp.NS_FEATURE:
|
||||
if gajim.HAVE_PYCRYPTO:
|
||||
self._FeatureNegCB(con, msg, session)
|
||||
return
|
||||
if msg.getTag('init') and msg.getTag('init').namespace == \
|
||||
common.xmpp.NS_ESESSION_INIT:
|
||||
self._InitE2ECB(con, msg, session)
|
||||
|
||||
encrypted = False
|
||||
tim = msg.getTimestamp()
|
||||
tim = helpers.datetime_tuple(tim)
|
||||
tim = localtime(timegm(tim))
|
||||
|
||||
e2e_tag = msg.getTag('c', namespace = common.xmpp.NS_STANZA_CRYPTO)
|
||||
if e2e_tag:
|
||||
encrypted = True
|
||||
|
||||
try:
|
||||
msg = session.decrypt_stanza(msg)
|
||||
except:
|
||||
self.dispatch('FAILED_DECRYPT', (frm, tim))
|
||||
|
||||
msgtxt = msg.getBody()
|
||||
msghtml = msg.getXHTML()
|
||||
mtype = msg.getType()
|
||||
subject = msg.getSubject() # if not there, it's None
|
||||
tim = msg.getTimestamp()
|
||||
tim = helpers.datetime_tuple(tim)
|
||||
|
@ -1490,7 +1575,6 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
|
|||
if not no_log_for:
|
||||
no_log_for = ''
|
||||
no_log_for = no_log_for.split()
|
||||
encrypted = False
|
||||
chatstate = None
|
||||
encTag = msg.getTag('x', namespace = common.xmpp.NS_ENCRYPTED)
|
||||
decmsg = ''
|
||||
|
@ -1510,8 +1594,17 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
|
|||
for xtag in xtags:
|
||||
if xtag.getNamespace() == common.xmpp.NS_CONFERENCE and not invite:
|
||||
room_jid = xtag.getAttr('jid')
|
||||
self.dispatch('GC_INVITATION', (room_jid, frm, '', None))
|
||||
is_continued = False
|
||||
if xtag.getTag('continue'):
|
||||
is_continued = True
|
||||
self.dispatch('GC_INVITATION', (room_jid, frm, '', None,
|
||||
is_continued))
|
||||
return
|
||||
form_node = None
|
||||
for xtag in xtags:
|
||||
if xtag.getNamespace() == common.xmpp.NS_DATA:
|
||||
form_node = xtag
|
||||
break
|
||||
# chatstates - look for chatstate tags in a message if not delayed
|
||||
if not delayed:
|
||||
composing_xep = False
|
||||
|
@ -1541,6 +1634,8 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
|
|||
keyID = gajim.config.get_per('accounts', self.name, 'keyid')
|
||||
if keyID:
|
||||
decmsg = self.gpg.decrypt(encmsg, keyID)
|
||||
# \x00 chars are not allowed in C (so in GTK)
|
||||
decmsg = decmsg.replace('\x00', '')
|
||||
if decmsg:
|
||||
msgtxt = decmsg
|
||||
encrypted = True
|
||||
|
@ -1549,7 +1644,7 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
|
|||
if not error_msg:
|
||||
error_msg = msgtxt
|
||||
msgtxt = None
|
||||
if self.name not in no_log_for:
|
||||
if session.is_loggable():
|
||||
try:
|
||||
gajim.logger.write('error', frm, error_msg, tim = tim,
|
||||
subject = subject)
|
||||
|
@ -1565,20 +1660,21 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
|
|||
if subject != None:
|
||||
self.dispatch('GC_SUBJECT', (frm, subject, msgtxt, has_timestamp))
|
||||
else:
|
||||
statusCode = msg.getStatusCode()
|
||||
if not msg.getTag('body'): #no <body>
|
||||
# It could be a config change. See
|
||||
# http://www.xmpp.org/extensions/xep-0045.html#roomconfig-notify
|
||||
if msg.getTag('x'):
|
||||
statusCode = msg.getStatusCode()
|
||||
if statusCode != []:
|
||||
self.dispatch('GC_CONFIG_CHANGE', (jid, statusCode))
|
||||
return
|
||||
# Ignore message from room in which we are not
|
||||
if not self.last_history_line.has_key(jid):
|
||||
return
|
||||
self.dispatch('GC_MSG', (frm, msgtxt, tim, has_timestamp, msghtml))
|
||||
if self.name not in no_log_for and not int(float(mktime(tim)))\
|
||||
<= self.last_history_line[jid] and msgtxt:
|
||||
self.dispatch('GC_MSG', (frm, msgtxt, tim, has_timestamp, msghtml,
|
||||
statusCode))
|
||||
if self.name not in no_log_for and jid not in no_log_for and not \
|
||||
int(float(mktime(tim))) <= self.last_history_line[jid] and msgtxt:
|
||||
try:
|
||||
gajim.logger.write('gc_msg', frm, msgtxt, tim = tim)
|
||||
except exceptions.PysqliteOperationalError, e:
|
||||
|
@ -1587,8 +1683,7 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
|
|||
elif mtype == 'chat': # it's type 'chat'
|
||||
if not msg.getTag('body') and chatstate is None: #no <body>
|
||||
return
|
||||
if msg.getTag('body') and self.name not in no_log_for and jid not in\
|
||||
no_log_for and msgtxt:
|
||||
if msg.getTag('body') and session.is_loggable() and msgtxt:
|
||||
try:
|
||||
msg_id = gajim.logger.write('chat_msg_recv', frm, msgtxt,
|
||||
tim = tim, subject = subject)
|
||||
|
@ -1601,9 +1696,13 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
|
|||
reason = item.getTagData('reason')
|
||||
item = invite.getTag('password')
|
||||
password = invite.getTagData('password')
|
||||
self.dispatch('GC_INVITATION',(frm, jid_from, reason, password))
|
||||
is_continued = False
|
||||
if invite.getTag('invite').getTag('continue'):
|
||||
is_continued = True
|
||||
self.dispatch('GC_INVITATION',(frm, jid_from, reason, password,
|
||||
is_continued))
|
||||
return
|
||||
if self.name not in no_log_for and jid not in no_log_for and msgtxt:
|
||||
if session.is_loggable()and msgtxt:
|
||||
try:
|
||||
gajim.logger.write('single_msg_recv', frm, msgtxt, tim = tim,
|
||||
subject = subject)
|
||||
|
@ -1614,9 +1713,87 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
|
|||
if treat_as:
|
||||
mtype = treat_as
|
||||
self.dispatch('MSG', (frm, msgtxt, tim, encrypted, mtype,
|
||||
subject, chatstate, msg_id, composing_xep, user_nick, msghtml))
|
||||
subject, chatstate, msg_id, composing_xep, user_nick, msghtml,
|
||||
session, form_node))
|
||||
# END messageCB
|
||||
|
||||
def get_session(self, jid, thread_id, type):
|
||||
'''returns an existing session between this connection and 'jid', returns a new one if none exist.'''
|
||||
session = self.find_session(jid, thread_id, type)
|
||||
|
||||
if session:
|
||||
return session
|
||||
else:
|
||||
# it's possible we initiated a session with a bare JID and this is the
|
||||
# first time we've seen a resource
|
||||
bare_jid = gajim.get_jid_without_resource(jid)
|
||||
if bare_jid != jid:
|
||||
session = self.find_session(bare_jid, thread_id, type)
|
||||
if session:
|
||||
if not session.received_thread_id:
|
||||
thread_id = session.thread_id
|
||||
|
||||
self.move_session(bare_jid, thread_id, jid.split("/")[1])
|
||||
return session
|
||||
|
||||
return self.make_new_session(jid, thread_id, type)
|
||||
|
||||
def find_session(self, jid, thread_id, type):
|
||||
try:
|
||||
if type == 'chat' and not thread_id:
|
||||
return self.find_null_session(jid)
|
||||
else:
|
||||
return self.sessions[jid][thread_id]
|
||||
except KeyError:
|
||||
return None
|
||||
|
||||
def delete_session(self, jid, thread_id):
|
||||
try:
|
||||
del self.sessions[jid][thread_id]
|
||||
|
||||
if not self.sessions[jid]:
|
||||
del self.sessions[jid]
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
def move_session(self, original_jid, thread_id, to_resource):
|
||||
'''moves a session to another resource.'''
|
||||
session = self.sessions[original_jid][thread_id]
|
||||
|
||||
del self.sessions[original_jid][thread_id]
|
||||
|
||||
new_jid = gajim.get_jid_without_resource(original_jid) + '/' + to_resource
|
||||
session.jid = common.xmpp.JID(new_jid)
|
||||
|
||||
if not new_jid in self.sessions:
|
||||
self.sessions[new_jid] = {}
|
||||
|
||||
self.sessions[new_jid][thread_id] = session
|
||||
|
||||
def find_null_session(self, jid):
|
||||
'''finds all of the sessions between us and jid that jid hasn't sent a thread_id in yet.
|
||||
|
||||
returns the session that we last sent a message to.'''
|
||||
|
||||
sessions_with_jid = self.sessions[jid].values()
|
||||
no_threadid_sessions = filter(lambda s: not s.received_thread_id, sessions_with_jid)
|
||||
|
||||
if no_threadid_sessions:
|
||||
no_threadid_sessions.sort(key=lambda s: s.last_send)
|
||||
return no_threadid_sessions[-1]
|
||||
else:
|
||||
return None
|
||||
|
||||
def make_new_session(self, jid, thread_id = None, type = 'chat'):
|
||||
sess = EncryptedStanzaSession(self, common.xmpp.JID(jid), thread_id, type)
|
||||
|
||||
if not jid in self.sessions:
|
||||
self.sessions[jid] = {}
|
||||
|
||||
self.sessions[jid][sess.thread_id] = sess
|
||||
|
||||
return sess
|
||||
|
||||
def _pubsubEventCB(self, con, msg):
|
||||
''' Called when we receive <message/> with pubsub event. '''
|
||||
# TODO: Logging? (actually services where logging would be useful, should
|
||||
|
@ -1663,12 +1840,12 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
|
|||
who = helpers.get_full_jid_from_iq(prs)
|
||||
except:
|
||||
if prs.getTag('error').getTag('jid-malformed'):
|
||||
# wrong jid, we probably tried to change our nick in a room to a non valid
|
||||
# one
|
||||
# wrong jid, we probably tried to change our nick in a room to a non
|
||||
# valid one
|
||||
who = str(prs.getFrom())
|
||||
jid_stripped, resource = gajim.get_room_and_nick_from_fjid(who)
|
||||
self.dispatch('GC_MSG', (jid_stripped,
|
||||
_('Nickname not allowed: %s') % resource, None, False, None))
|
||||
_('Nickname not allowed: %s') % resource, None, False, None, []))
|
||||
return
|
||||
jid_stripped, resource = gajim.get_room_and_nick_from_fjid(who)
|
||||
timestamp = None
|
||||
|
@ -1722,8 +1899,8 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
|
|||
except:
|
||||
prio = 0
|
||||
keyID = ''
|
||||
if sigTag and GnuPG.USE_GPG:
|
||||
#verify
|
||||
if sigTag and self.gpg:
|
||||
# verify
|
||||
sigmsg = sigTag.getData()
|
||||
keyID = self.gpg.verify(status, sigmsg)
|
||||
|
||||
|
@ -1827,7 +2004,7 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
|
|||
else:
|
||||
if not status:
|
||||
status = _('I would like to add you to my roster.')
|
||||
self.dispatch('SUBSCRIBE', (who, status, user_nick))
|
||||
self.dispatch('SUBSCRIBE', (jid_stripped, status, user_nick))
|
||||
elif ptype == 'subscribed':
|
||||
if jid_stripped in self.automatically_added:
|
||||
self.automatically_added.remove(jid_stripped)
|
||||
|
@ -1894,6 +2071,11 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
|
|||
gajim.logger.write('status', jid_stripped, status, show)
|
||||
except exceptions.PysqliteOperationalError, e:
|
||||
self.dispatch('ERROR', (_('Disk Write Error'), str(e)))
|
||||
our_jid = gajim.get_jid_from_account(self.name)
|
||||
if jid_stripped == our_jid and resource == self.server_resource:
|
||||
# We got our own presence
|
||||
self.dispatch('STATUS', show)
|
||||
else:
|
||||
self.dispatch('NOTIFY', (jid_stripped, show, status, resource, prio,
|
||||
keyID, timestamp, contact_nickname))
|
||||
# END presenceCB
|
||||
|
@ -1993,9 +2175,29 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
|
|||
|
||||
# continue connection
|
||||
if self.connected > 1 and self.continue_connect_info:
|
||||
msg = self.continue_connect_info[1]
|
||||
sign_msg = self.continue_connect_info[2]
|
||||
signed = ''
|
||||
if sign_msg:
|
||||
signed = self.get_signed_presence(msg, self._send_first_presence)
|
||||
if signed is None:
|
||||
self.dispatch('GPG_PASSWORD_REQUIRED',
|
||||
(self._send_first_presence,))
|
||||
# _send_first_presence will be called when user enter passphrase
|
||||
return
|
||||
self._send_first_presence(signed)
|
||||
|
||||
def _send_first_presence(self, signed = ''):
|
||||
show = self.continue_connect_info[0]
|
||||
msg = self.continue_connect_info[1]
|
||||
signed = self.continue_connect_info[2]
|
||||
sign_msg = self.continue_connect_info[2]
|
||||
if sign_msg and not signed:
|
||||
signed = self.get_signed_presence(msg)
|
||||
if signed is None:
|
||||
self.dispatch('ERROR', (_('OpenPGP passphrase was not given'),
|
||||
#%s is the account name here
|
||||
_('You will be connected to %s without OpenPGP.') % self.name))
|
||||
signed = ''
|
||||
self.connected = STATUS_LIST.index(show)
|
||||
sshow = helpers.get_xmpp_show(show)
|
||||
# send our presence
|
||||
|
@ -2003,7 +2205,8 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
|
|||
self.send_invisible_presence(msg, signed, True)
|
||||
return
|
||||
priority = gajim.get_priority(self.name, sshow)
|
||||
vcard = self.get_cached_vcard(jid)
|
||||
our_jid = helpers.parse_jid(gajim.get_jid_from_account(self.name))
|
||||
vcard = self.get_cached_vcard(our_jid)
|
||||
if vcard and vcard.has_key('PHOTO') and vcard['PHOTO'].has_key('SHA'):
|
||||
self.vcard_sha = vcard['PHOTO']['SHA']
|
||||
p = common.xmpp.Presence(typ = None, priority = priority, show = sshow)
|
||||
|
@ -2026,7 +2229,7 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
|
|||
# Get annotations from private namespace
|
||||
self.get_annotations()
|
||||
|
||||
#Inform GUI we just signed in
|
||||
# Inform GUI we just signed in
|
||||
self.dispatch('SIGNED_IN', ())
|
||||
self.continue_connect_info = None
|
||||
|
||||
|
|
|
@ -1,20 +1,25 @@
|
|||
## common/contacts.py
|
||||
##
|
||||
## Copyright (C) 2006 Yann Le Boulanger <asterix@lagaule.org>
|
||||
## Copyright (C) 2006 Nikos Kouremenos <kourem@gmail.com>
|
||||
## Copyright (C) 2006 Yann Leboulanger <asterix@lagaule.org>
|
||||
## Nikos Kouremenos <kourem@gmail.com>
|
||||
## Copyright (C) 2007 Lukas Petrovicky <lukas@petrovicky.net>
|
||||
## Copyright (C) 2007 Julien Pivotto <roidelapluie@gmail.com>
|
||||
## Julien Pivotto <roidelapluie@gmail.com>
|
||||
## Stephan Erb <steve-e@h3c.de>
|
||||
##
|
||||
## This file is part of Gajim.
|
||||
##
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## Gajim 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; version 2 only.
|
||||
## by the Free Software Foundation; version 3 only.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## Gajim 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 Gajim. If not, see <http://www.gnu.org/licenses/>.
|
||||
##
|
||||
|
||||
import common.gajim
|
||||
|
||||
|
@ -41,9 +46,9 @@ class Contact:
|
|||
|
||||
# Capabilities; filled by caps.py/ConnectionCaps object
|
||||
# every time it gets these from presence stanzas
|
||||
self.caps_node=None
|
||||
self.caps_ver=None
|
||||
self.caps_exts=None
|
||||
self.caps_node = None
|
||||
self.caps_ver = None
|
||||
self.caps_exts = None
|
||||
|
||||
# please read jep-85 http://www.jabber.org/jeps/jep-0085.html
|
||||
# we keep track of jep85 support with the peer by three extra states:
|
||||
|
@ -206,6 +211,9 @@ class Contacts:
|
|||
if len(self._contacts[account][contact.jid]) == 0:
|
||||
del self._contacts[account][contact.jid]
|
||||
|
||||
def clear_contacts(self, account):
|
||||
self._contacts[account] = {}
|
||||
|
||||
def remove_jid(self, account, jid):
|
||||
'''Removes all contacts for a given jid'''
|
||||
if not self._contacts.has_key(account):
|
||||
|
@ -281,6 +289,10 @@ class Contacts:
|
|||
for account in accounts:
|
||||
our_jid = common.gajim.get_jid_from_account(account)
|
||||
for jid in self.get_jid_list(account):
|
||||
if self.has_brother(account, jid) and not \
|
||||
self.is_big_brother(account, jid):
|
||||
# count metacontacts only once
|
||||
continue
|
||||
if jid == our_jid:
|
||||
continue
|
||||
if common.gajim.jid_is_transport(jid) and not \
|
||||
|
@ -300,6 +312,8 @@ class Contacts:
|
|||
# Transports group
|
||||
if common.gajim.jid_is_transport(jid):
|
||||
contact_groups = [_('Transports')]
|
||||
if contact.is_observer():
|
||||
contact_groups = [_('Observers')]
|
||||
else:
|
||||
contact_groups = [_('General')]
|
||||
for group in groups:
|
||||
|
@ -362,7 +376,7 @@ class Contacts:
|
|||
found = data
|
||||
break
|
||||
if found:
|
||||
self._metacontacts_tags[account][tag].remove(data)
|
||||
self._metacontacts_tags[account][tag].remove(found)
|
||||
break
|
||||
common.gajim.connections[account].store_metacontacts(
|
||||
self._metacontacts_tags[account])
|
||||
|
@ -374,6 +388,17 @@ class Contacts:
|
|||
return True
|
||||
return False
|
||||
|
||||
def is_big_brother(self, account, jid):
|
||||
tag = self.get_metacontacts_tag(account, jid)
|
||||
if tag:
|
||||
family = self.get_metacontacts_family(account, jid)
|
||||
bb_data = self.get_metacontacts_big_brother(family)
|
||||
bb_jid = bb_data['jid']
|
||||
bb_account = bb_data['account']
|
||||
if bb_jid == jid and bb_account == account:
|
||||
return True
|
||||
return False
|
||||
|
||||
def get_metacontacts_jids(self, tag):
|
||||
'''Returns all jid for the given tag in the form {acct: [jid1, jid2],.}'''
|
||||
answers = {}
|
||||
|
@ -399,48 +424,71 @@ class Contacts:
|
|||
answers.append(data)
|
||||
return answers
|
||||
|
||||
def _get_data_score(self, data):
|
||||
'''compute thescore of a gived data
|
||||
data is {'jid': jid, 'account': account, 'order': order}
|
||||
order is optional
|
||||
score = (max_order - order)*10000 + is_jabber*priority*10 + status'''
|
||||
jid = data['jid']
|
||||
account = data['account']
|
||||
max_order = 0
|
||||
order = 0
|
||||
if data.has_key('order'):
|
||||
order = data['order']
|
||||
if order:
|
||||
family = self.get_metacontacts_family(account, jid)
|
||||
for data_ in family:
|
||||
if data_.has_key('order') and data_['order'] > max_order:
|
||||
max_order = data_['order']
|
||||
contact = self.get_contact_with_highest_priority(account, jid)
|
||||
score = (max_order - order)*10000
|
||||
|
||||
if common.gajim.get_transport_name_from_jid(jid) is None and \
|
||||
contact.show not in ('error', 'offline'):
|
||||
score += 10
|
||||
if contact.priority > 0:
|
||||
score += contact.priority * 10
|
||||
score += ['not in roster', 'error', 'offline', 'invisible', 'dnd', 'xa',
|
||||
'away', 'chat', 'online', 'requested', 'message'].index(contact.show)
|
||||
if contact.show == 'offline' and contact.status:
|
||||
# Offline contacts with a status message have highest score
|
||||
score += 1
|
||||
return score
|
||||
def compare_metacontacts(self, data1, data2):
|
||||
'''compare 2 metacontacts.
|
||||
Data is {'jid': jid, 'account': account, 'order': order}
|
||||
order is optional'''
|
||||
jid1 = data1['jid']
|
||||
jid2 = data2['jid']
|
||||
account1 = data1['account']
|
||||
account2 = data2['account']
|
||||
contact1 = self.get_contact_with_highest_priority(account1, jid1)
|
||||
contact2 = self.get_contact_with_highest_priority(account2, jid2)
|
||||
show_list = ['not in roster', 'error', 'offline', 'invisible', 'dnd',
|
||||
'xa', 'away', 'chat', 'online', 'requested', 'message']
|
||||
# contact can be null when we fill the roster on connection
|
||||
if not contact1:
|
||||
show1 = 0
|
||||
priority1 = 0
|
||||
else:
|
||||
show1 = show_list.index(contact1.show)
|
||||
priority1 = contact1.priority
|
||||
if not contact2:
|
||||
show2 = 0
|
||||
priority2 = 0
|
||||
else:
|
||||
show2 = show_list.index(contact2.show)
|
||||
priority2 = contact2.priority
|
||||
# If only one is offline, it's always second
|
||||
if show1 > 2 and show2 < 3:
|
||||
return 1
|
||||
if show2 > 2 and show1 < 3:
|
||||
return -1
|
||||
if 'order' in data1 and 'order' in data2:
|
||||
if data1['order'] > data2['order']:
|
||||
return 1
|
||||
if data1['order'] < data2['order']:
|
||||
return -1
|
||||
transport1 = common.gajim.get_transport_name_from_jid(jid1)
|
||||
transport2 = common.gajim.get_transport_name_from_jid(jid2)
|
||||
if transport2 and not transport1:
|
||||
return 1
|
||||
if transport1 and not transport2:
|
||||
return -1
|
||||
if priority1 > priority2:
|
||||
return 1
|
||||
if priority2 > priority1:
|
||||
return -1
|
||||
if show1 > show2:
|
||||
return 1
|
||||
if show2 > show1:
|
||||
return -1
|
||||
if jid1 > jid2:
|
||||
return 1
|
||||
if jid2 > jid1:
|
||||
return -1
|
||||
# If all is the same, compare accounts, they can't be the same
|
||||
if account1 > account2:
|
||||
return 1
|
||||
if account2 > account1:
|
||||
return -1
|
||||
return 0
|
||||
|
||||
def get_metacontacts_big_brother(self, family):
|
||||
'''which of the family will be the big brother under wich all
|
||||
others will be ?'''
|
||||
max_score = 0
|
||||
max_data = family[0]
|
||||
for data in family:
|
||||
score = self._get_data_score(data)
|
||||
if score > max_score:
|
||||
max_score = score
|
||||
max_data = data
|
||||
return max_data
|
||||
family.sort(cmp=self.compare_metacontacts)
|
||||
return family[-1]
|
||||
|
||||
def is_pm_from_jid(self, account, jid):
|
||||
'''Returns True if the given jid is a private message jid'''
|
||||
|
|
|
@ -0,0 +1,86 @@
|
|||
# common crypto functions (mostly specific to XEP-0116, but useful elsewhere)
|
||||
|
||||
import os
|
||||
import math
|
||||
|
||||
from Crypto.Hash import SHA256
|
||||
|
||||
# convert a large integer to a big-endian bitstring
|
||||
def encode_mpi(n):
|
||||
if n >= 256:
|
||||
return encode_mpi(n / 256) + chr(n % 256)
|
||||
else:
|
||||
return chr(n)
|
||||
|
||||
# convert a large integer to a big-endian bitstring, padded with \x00s to
|
||||
# a multiple of 16 bytes
|
||||
def encode_mpi_with_padding(n):
|
||||
return pad_to_multiple(encode_mpi(n), 16, '\x00', True)
|
||||
|
||||
# pad 'string' to a multiple of 'multiple_of' with 'char'.
|
||||
# pad on the left if 'left', otherwise pad on the right.
|
||||
def pad_to_multiple(string, multiple_of, char, left):
|
||||
mod = len(string) % multiple_of
|
||||
if mod == 0:
|
||||
return string
|
||||
else:
|
||||
padding = (multiple_of - mod) * char
|
||||
|
||||
if left:
|
||||
return padding + string
|
||||
else:
|
||||
return string + padding
|
||||
|
||||
# convert a big-endian bitstring to an integer
|
||||
def decode_mpi(s):
|
||||
if len(s) == 0:
|
||||
return 0
|
||||
else:
|
||||
return 256 * decode_mpi(s[:-1]) + ord(s[-1])
|
||||
|
||||
def sha256(string):
|
||||
sh = SHA256.new()
|
||||
sh.update(string)
|
||||
return sh.digest()
|
||||
|
||||
base28_chr = "acdefghikmopqruvwxy123456789"
|
||||
|
||||
def sas_28x5(m_a, form_b):
|
||||
sha = sha256(m_a + form_b + 'Short Authentication String')
|
||||
lsb24 = decode_mpi(sha[-3:])
|
||||
return base28(lsb24)
|
||||
|
||||
def base28(n):
|
||||
if n >= 28:
|
||||
return base28(n / 28) + base28_chr[n % 28]
|
||||
else:
|
||||
return base28_chr[n]
|
||||
|
||||
def random_bytes(bytes):
|
||||
return os.urandom(bytes)
|
||||
|
||||
def generate_nonce():
|
||||
return random_bytes(8)
|
||||
|
||||
# generate a random number between 'bottom' and 'top'
|
||||
def srand(bottom, top):
|
||||
# minimum number of bytes needed to represent that range
|
||||
bytes = int(math.ceil(math.log(top - bottom, 256)))
|
||||
|
||||
# in retrospect, this is horribly inadequate.
|
||||
return (decode_mpi(random_bytes(bytes)) % (top - bottom)) + bottom
|
||||
|
||||
# a faster version of (base ** exp) % mod
|
||||
# taken from <http://lists.danga.com/pipermail/yadis/2005-September/001445.html>
|
||||
def powmod(base, exp, mod):
|
||||
square = base % mod
|
||||
result = 1
|
||||
|
||||
while exp > 0:
|
||||
if exp & 1: # exponent is odd
|
||||
result = (result * square) % mod
|
||||
|
||||
square = (square * square) % mod
|
||||
exp /= 2
|
||||
|
||||
return result
|
|
@ -170,7 +170,7 @@ class BooleanField(DataField):
|
|||
v = self.getTagData('value')
|
||||
if v in ('0', 'false'): return False
|
||||
if v in ('1', 'true'): return True
|
||||
if v is None: return None
|
||||
if v is None: return False # default value is False
|
||||
raise WrongFieldValue
|
||||
def fset(self, value):
|
||||
self.setTagData('value', value and '1' or '0')
|
||||
|
|
|
@ -1,21 +1,26 @@
|
|||
## dbus_support.py
|
||||
##
|
||||
## Copyright (C) 2005 Yann Le Boulanger <asterix@lagaule.org>
|
||||
## Copyright (C) 2005 Yann Leboulanger <asterix@lagaule.org>
|
||||
## Copyright (C) 2005 Nikos Kouremenos <kourem@gmail.com>
|
||||
## Copyright (C) 2005 Dimitur Kirov <dkirov@gmail.com>
|
||||
## Copyright (C) 2005 Andrew Sayman <lorien420@myrealbox.com>
|
||||
##
|
||||
## 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; version 2 only.
|
||||
## This file is part of Gajim.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## Gajim 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; version 3 only.
|
||||
##
|
||||
## Gajim 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 Gajim. If not, see <http://www.gnu.org/licenses/>.
|
||||
##
|
||||
|
||||
import os
|
||||
import os, sys
|
||||
|
||||
from common import gajim
|
||||
from common import exceptions
|
||||
|
@ -23,10 +28,13 @@ from common import exceptions
|
|||
_GAJIM_ERROR_IFACE = 'org.gajim.dbus.Error'
|
||||
|
||||
try:
|
||||
if sys.platform == 'darwin':
|
||||
import osx.dbus
|
||||
osx.dbus.load(True)
|
||||
import dbus
|
||||
import dbus.service
|
||||
import dbus.glib
|
||||
supported = True # does use have D-Bus bindings?
|
||||
supported = True # does user have D-Bus bindings?
|
||||
except ImportError:
|
||||
supported = False
|
||||
if not os.name == 'nt': # only say that to non Windows users
|
||||
|
@ -98,7 +106,7 @@ class SessionBus:
|
|||
session_bus = SessionBus()
|
||||
|
||||
def get_interface(interface, path):
|
||||
'''Returns an interface on the current SessionBus. If the interface isn't
|
||||
'''Returns an interface on the current SessionBus. If the interface isn\'t
|
||||
running, it tries to start it first.'''
|
||||
if not supported:
|
||||
return None
|
||||
|
|
|
@ -2,7 +2,7 @@ docdir = '../'
|
|||
|
||||
datadir = '../'
|
||||
|
||||
version = '0.11.1.5'
|
||||
version = '0.11.4.0-svn'
|
||||
|
||||
import sys, os.path
|
||||
for base in ('.', 'common'):
|
||||
|
|
|
@ -0,0 +1,207 @@
|
|||
import string
|
||||
|
||||
# This file defines a number of constants; specifically, large primes suitable for
|
||||
# use with the Diffie-Hellman key exchange.
|
||||
#
|
||||
# These constants have been obtained from RFC2409 and RFC3526.
|
||||
|
||||
generators = [ None, # one to get the right offset
|
||||
2,
|
||||
2,
|
||||
None,
|
||||
None,
|
||||
2,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
2, # group 14
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
]
|
||||
|
||||
hex_primes = [ None,
|
||||
|
||||
# group 1
|
||||
'''FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1
|
||||
29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD
|
||||
EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245
|
||||
E485B576 625E7EC6 F44C42E9 A63A3620 FFFFFFFF FFFFFFFF''',
|
||||
|
||||
# group 2
|
||||
'''FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1
|
||||
29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD
|
||||
EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245
|
||||
E485B576 625E7EC6 F44C42E9 A637ED6B 0BFF5CB6 F406B7ED
|
||||
EE386BFB 5A899FA5 AE9F2411 7C4B1FE6 49286651 ECE65381
|
||||
FFFFFFFF FFFFFFFF''',
|
||||
|
||||
# XXX how do I obtain these?
|
||||
None,
|
||||
None,
|
||||
|
||||
# group 5
|
||||
'''FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1
|
||||
29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD
|
||||
EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245
|
||||
E485B576 625E7EC6 F44C42E9 A637ED6B 0BFF5CB6 F406B7ED
|
||||
EE386BFB 5A899FA5 AE9F2411 7C4B1FE6 49286651 ECE45B3D
|
||||
C2007CB8 A163BF05 98DA4836 1C55D39A 69163FA8 FD24CF5F
|
||||
83655D23 DCA3AD96 1C62F356 208552BB 9ED52907 7096966D
|
||||
670C354E 4ABC9804 F1746C08 CA237327 FFFFFFFF FFFFFFFF''',
|
||||
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
|
||||
# group 14
|
||||
'''FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1
|
||||
29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD
|
||||
EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245
|
||||
E485B576 625E7EC6 F44C42E9 A637ED6B 0BFF5CB6 F406B7ED
|
||||
EE386BFB 5A899FA5 AE9F2411 7C4B1FE6 49286651 ECE45B3D
|
||||
C2007CB8 A163BF05 98DA4836 1C55D39A 69163FA8 FD24CF5F
|
||||
83655D23 DCA3AD96 1C62F356 208552BB 9ED52907 7096966D
|
||||
670C354E 4ABC9804 F1746C08 CA18217C 32905E46 2E36CE3B
|
||||
E39E772C 180E8603 9B2783A2 EC07A28F B5C55DF0 6F4C52C9
|
||||
DE2BCBF6 95581718 3995497C EA956AE5 15D22618 98FA0510
|
||||
15728E5A 8AACAA68 FFFFFFFF FFFFFFFF''',
|
||||
|
||||
# group 15
|
||||
'''FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1
|
||||
29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD
|
||||
EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245
|
||||
E485B576 625E7EC6 F44C42E9 A637ED6B 0BFF5CB6 F406B7ED
|
||||
EE386BFB 5A899FA5 AE9F2411 7C4B1FE6 49286651 ECE45B3D
|
||||
C2007CB8 A163BF05 98DA4836 1C55D39A 69163FA8 FD24CF5F
|
||||
83655D23 DCA3AD96 1C62F356 208552BB 9ED52907 7096966D
|
||||
670C354E 4ABC9804 F1746C08 CA18217C 32905E46 2E36CE3B
|
||||
E39E772C 180E8603 9B2783A2 EC07A28F B5C55DF0 6F4C52C9
|
||||
DE2BCBF6 95581718 3995497C EA956AE5 15D22618 98FA0510
|
||||
15728E5A 8AAAC42D AD33170D 04507A33 A85521AB DF1CBA64
|
||||
ECFB8504 58DBEF0A 8AEA7157 5D060C7D B3970F85 A6E1E4C7
|
||||
ABF5AE8C DB0933D7 1E8C94E0 4A25619D CEE3D226 1AD2EE6B
|
||||
F12FFA06 D98A0864 D8760273 3EC86A64 521F2B18 177B200C
|
||||
BBE11757 7A615D6C 770988C0 BAD946E2 08E24FA0 74E5AB31
|
||||
43DB5BFC E0FD108E 4B82D120 A93AD2CA FFFFFFFF FFFFFFFF''',
|
||||
|
||||
# group 16
|
||||
'''FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1
|
||||
29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD
|
||||
EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245
|
||||
E485B576 625E7EC6 F44C42E9 A637ED6B 0BFF5CB6 F406B7ED
|
||||
EE386BFB 5A899FA5 AE9F2411 7C4B1FE6 49286651 ECE45B3D
|
||||
C2007CB8 A163BF05 98DA4836 1C55D39A 69163FA8 FD24CF5F
|
||||
83655D23 DCA3AD96 1C62F356 208552BB 9ED52907 7096966D
|
||||
670C354E 4ABC9804 F1746C08 CA18217C 32905E46 2E36CE3B
|
||||
E39E772C 180E8603 9B2783A2 EC07A28F B5C55DF0 6F4C52C9
|
||||
DE2BCBF6 95581718 3995497C EA956AE5 15D22618 98FA0510
|
||||
15728E5A 8AAAC42D AD33170D 04507A33 A85521AB DF1CBA64
|
||||
ECFB8504 58DBEF0A 8AEA7157 5D060C7D B3970F85 A6E1E4C7
|
||||
ABF5AE8C DB0933D7 1E8C94E0 4A25619D CEE3D226 1AD2EE6B
|
||||
F12FFA06 D98A0864 D8760273 3EC86A64 521F2B18 177B200C
|
||||
BBE11757 7A615D6C 770988C0 BAD946E2 08E24FA0 74E5AB31
|
||||
43DB5BFC E0FD108E 4B82D120 A9210801 1A723C12 A787E6D7
|
||||
88719A10 BDBA5B26 99C32718 6AF4E23C 1A946834 B6150BDA
|
||||
2583E9CA 2AD44CE8 DBBBC2DB 04DE8EF9 2E8EFC14 1FBECAA6
|
||||
287C5947 4E6BC05D 99B2964F A090C3A2 233BA186 515BE7ED
|
||||
1F612970 CEE2D7AF B81BDD76 2170481C D0069127 D5B05AA9
|
||||
93B4EA98 8D8FDDC1 86FFFB7DC 90A6C08F 4DF435C9 34063199
|
||||
FFFFFFFF FFFFFFFF''',
|
||||
|
||||
# group 17
|
||||
'''FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1 29024E08
|
||||
8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD EF9519B3 CD3A431B
|
||||
302B0A6D F25F1437 4FE1356D 6D51C245 E485B576 625E7EC6 F44C42E9
|
||||
A637ED6B 0BFF5CB6 F406B7ED EE386BFB 5A899FA5 AE9F2411 7C4B1FE6
|
||||
49286651 ECE45B3D C2007CB8 A163BF05 98DA4836 1C55D39A 69163FA8
|
||||
FD24CF5F 83655D23 DCA3AD96 1C62F356 208552BB 9ED52907 7096966D
|
||||
670C354E 4ABC9804 F1746C08 CA18217C 32905E46 2E36CE3B E39E772C
|
||||
180E8603 9B2783A2 EC07A28F B5C55DF0 6F4C52C9 DE2BCBF6 95581718
|
||||
3995497C EA956AE5 15D22618 98FA0510 15728E5A 8AAAC42D AD33170D
|
||||
04507A33 A85521AB DF1CBA64 ECFB8504 58DBEF0A 8AEA7157 5D060C7D
|
||||
B3970F85 A6E1E4C7 ABF5AE8C DB0933D7 1E8C94E0 4A25619D CEE3D226
|
||||
1AD2EE6B F12FFA06 D98A0864 D8760273 3EC86A64 521F2B18 177B200C
|
||||
BBE11757 7A615D6C 770988C0 BAD946E2 08E24FA0 74E5AB31 43DB5BFC
|
||||
E0FD108E 4B82D120 A9210801 1A723C12 A787E6D7 88719A10 BDBA5B26
|
||||
99C32718 6AF4E23C 1A946834 B6150BDA 2583E9CA 2AD44CE8 DBBBC2DB
|
||||
04DE8EF9 2E8EFC14 1FBECAA6 287C5947 4E6BC05D 99B2964F A090C3A2
|
||||
233BA186 515BE7ED 1F612970 CEE2D7AF B81BDD76 2170481C D0069127
|
||||
D5B05AA9 93B4EA98 8D8FDDC1 86FFB7DC 90A6C08F 4DF435C9 34028492
|
||||
36C3FAB4 D27C7026 C1D4DCB2 602646DE C9751E76 3DBA37BD F8FF9406
|
||||
AD9E530E E5DB382F 413001AE B06A53ED 9027D831 179727B0 865A8918
|
||||
DA3EDBEB CF9B14ED 44CE6CBA CED4BB1B DB7F1447 E6CC254B 33205151
|
||||
2BD7AF42 6FB8F401 378CD2BF 5983CA01 C64B92EC F032EA15 D1721D03
|
||||
F482D7CE 6E74FEF6 D55E702F 46980C82 B5A84031 900B1C9E 59E7C97F
|
||||
BEC7E8F3 23A97A7E 36CC88BE 0F1D45B7 FF585AC5 4BD407B2 2B4154AA
|
||||
CC8F6D7E BF48E1D8 14CC5ED2 0F8037E0 A79715EE F29BE328 06A1D58B
|
||||
B7C5DA76 F550AA3D 8A1FBFF0 EB19CCB1 A313D55C DA56C9EC 2EF29632
|
||||
387FE8D7 6E3C0468 043E8F66 3F4860EE 12BF2D5B 0B7474D6 E694F91E
|
||||
6DCC4024 FFFFFFFF FFFFFFFF''',
|
||||
|
||||
# group 18
|
||||
'''FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1
|
||||
29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD
|
||||
EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245
|
||||
E485B576 625E7EC6 F44C42E9 A637ED6B 0BFF5CB6 F406B7ED
|
||||
EE386BFB 5A899FA5 AE9F2411 7C4B1FE6 49286651 ECE45B3D
|
||||
C2007CB8 A163BF05 98DA4836 1C55D39A 69163FA8 FD24CF5F
|
||||
83655D23 DCA3AD96 1C62F356 208552BB 9ED52907 7096966D
|
||||
670C354E 4ABC9804 F1746C08 CA18217C 32905E46 2E36CE3B
|
||||
E39E772C 180E8603 9B2783A2 EC07A28F B5C55DF0 6F4C52C9
|
||||
DE2BCBF6 95581718 3995497C EA956AE5 15D22618 98FA0510
|
||||
15728E5A 8AAAC42D AD33170D 04507A33 A85521AB DF1CBA64
|
||||
ECFB8504 58DBEF0A 8AEA7157 5D060C7D B3970F85 A6E1E4C7
|
||||
ABF5AE8C DB0933D7 1E8C94E0 4A25619D CEE3D226 1AD2EE6B
|
||||
F12FFA06 D98A0864 D8760273 3EC86A64 521F2B18 177B200C
|
||||
BBE11757 7A615D6C 770988C0 BAD946E2 08E24FA0 74E5AB31
|
||||
43DB5BFC E0FD108E 4B82D120 A9210801 1A723C12 A787E6D7
|
||||
88719A10 BDBA5B26 99C32718 6AF4E23C 1A946834 B6150BDA
|
||||
2583E9CA 2AD44CE8 DBBBC2DB 04DE8EF9 2E8EFC14 1FBECAA6
|
||||
287C5947 4E6BC05D 99B2964F A090C3A2 233BA186 515BE7ED
|
||||
1F612970 CEE2D7AF B81BDD76 2170481C D0069127 D5B05AA9
|
||||
93B4EA98 8D8FDDC1 86FFB7DC 90A6C08F 4DF435C9 34028492
|
||||
36C3FAB4 D27C7026 C1D4DCB2 602646DE C9751E76 3DBA37BD
|
||||
F8FF9406 AD9E530E E5DB382F 413001AE B06A53ED 9027D831
|
||||
179727B0 865A8918 DA3EDBEB CF9B14ED 44CE6CBA CED4BB1B
|
||||
DB7F1447 E6CC254B 33205151 2BD7AF42 6FB8F401 378CD2BF
|
||||
5983CA01 C64B92EC F032EA15 D1721D03 F482D7CE 6E74FEF6
|
||||
D55E702F 46980C82 B5A84031 900B1C9E 59E7C97F BEC7E8F3
|
||||
23A97A7E 36CC88BE 0F1D45B7 FF585AC5 4BD407B2 2B4154AA
|
||||
CC8F6D7E BF48E1D8 14CC5ED2 0F8037E0 A79715EE F29BE328
|
||||
06A1D58B B7C5DA76 F550AA3D 8A1FBFF0 EB19CCB1 A313D55C
|
||||
DA56C9EC 2EF29632 387FE8D7 6E3C0468 043E8F66 3F4860EE
|
||||
12BF2D5B 0B7474D6 E694F91E 6DBE1159 74A3926F 12FEE5E4
|
||||
38777CB6 A932DF8C D8BEC4D0 73B931BA 3BC832B6 8D9DD300
|
||||
741FA7BF 8AFC47ED 2576F693 6BA42466 3AAB639C 5AE4F568
|
||||
3423B474 2BF1C978 238F16CB E39D652D E3FDB8BE FC848AD9
|
||||
22222E04 A4037C07 13EB57A8 1A23F0C7 3473FC64 6CEA306B
|
||||
4BCBC886 2F8385DD FA9D4B7F A2C087E8 79683303 ED5BDD3A
|
||||
062B3CF5 B3A278A6 6D2A13F8 3F44F82D DF310EE0 74AB6A36
|
||||
4597E899 A0255DC1 64F31CC5 0846851D F9AB4819 5DED7EA1
|
||||
B1D510BD 7EE74D73 FAF36BC3 1ECFA268 359046F4 EB879F92
|
||||
4009438B 481C6CD7 889A002E D5EE382B C9190DA6 FC026E47
|
||||
9558E447 5677E9AA 9E3050E2 765694DF C81F56E8 80B96E71
|
||||
60C980DD 98EDD3DF FFFFFFFF FFFFFFFF'''
|
||||
]
|
||||
|
||||
all_ascii = ''.join(map(chr, range(256)))
|
||||
|
||||
def hex_to_decimal(stripee):
|
||||
if not stripee:
|
||||
return None
|
||||
|
||||
return int(stripee.translate(all_ascii, string.whitespace), 16)
|
||||
|
||||
primes = map(hex_to_decimal, hex_primes)
|
|
@ -1,24 +1,30 @@
|
|||
## common/events.py
|
||||
##
|
||||
## Contributors for this file:
|
||||
## - Yann Le Boulanger <asterix@lagaule.org>
|
||||
## - Yann Leboulanger <asterix@lagaule.org>
|
||||
##
|
||||
## Copyright (C) 2006 Yann Le Boulanger <asterix@lagaule.org>
|
||||
## Copyright (C) 2006 Yann Leboulanger <asterix@lagaule.org>
|
||||
## Vincent Hanquez <tab@snarc.org>
|
||||
## Nikos Kouremenos <kourem@gmail.com>
|
||||
## Dimitur Kirov <dkirov@gmail.com>
|
||||
## Travis Shirk <travis@pobox.com>
|
||||
## Norman Rasmussen <norman@rasmussen.co.za>
|
||||
## Copyright (C) 2007 Stephan Erb <steve-e@h3c.de>
|
||||
##
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## This file is part of Gajim.
|
||||
##
|
||||
## Gajim 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; version 2 only.
|
||||
## by the Free Software Foundation; version 3 only.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## Gajim 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 Gajim. If not, see <http://www.gnu.org/licenses/>.
|
||||
##
|
||||
|
||||
import time
|
||||
|
||||
|
@ -159,12 +165,22 @@ class Events:
|
|||
return self._get_nb_events(types = types, account = account)
|
||||
|
||||
def get_events(self, account, jid = None, types = []):
|
||||
'''if event is not specified, get all events from this jid,
|
||||
'''returns all events from the given account of the form
|
||||
{jid1: [], jid2: []}
|
||||
if jid is given, returns all events from the given jid in a list: []
|
||||
optionnaly only from given type'''
|
||||
if not self._events.has_key(account):
|
||||
return []
|
||||
if not jid:
|
||||
return self._events[account]
|
||||
events_list = {} # list of events
|
||||
for jid_ in self._events[account]:
|
||||
events = []
|
||||
for ev in self._events[account][jid_]:
|
||||
if not types or ev.type_ in types:
|
||||
events.append(ev)
|
||||
if events:
|
||||
events_list[jid_] = events
|
||||
return events_list
|
||||
if not self._events[account].has_key(jid):
|
||||
return []
|
||||
events_list = [] # list of events
|
||||
|
|
|
@ -1,17 +1,22 @@
|
|||
## exceptions.py
|
||||
##
|
||||
## Copyright (C) 2005-2006 Yann Le Boulanger <asterix@lagaule.org>
|
||||
## Copyright (C) 2005-2006 Yann Leboulanger <asterix@lagaule.org>
|
||||
## Copyright (C) 2005-2006 Nikos Kouremenos <kourem@gmail.com>
|
||||
##
|
||||
## 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; version 2 only.
|
||||
## This file is part of Gajim.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## Gajim 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; version 3 only.
|
||||
##
|
||||
## Gajim 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 Gajim. If not, see <http://www.gnu.org/licenses/>.
|
||||
##
|
||||
|
||||
class PysqliteNotAvailable(Exception):
|
||||
'''sqlite2 is not installed or python bindings are missing'''
|
||||
|
@ -54,8 +59,20 @@ class SessionBusNotPresent(Exception):
|
|||
def __str__(self):
|
||||
return _('Session bus is not available.\nTry reading http://trac.gajim.org/wiki/GajimDBus')
|
||||
|
||||
class NegotiationError(Exception):
|
||||
'''A session negotiation failed'''
|
||||
pass
|
||||
|
||||
class DecryptionError(Exception):
|
||||
'''A message couldn't be decrypted into usable XML'''
|
||||
pass
|
||||
|
||||
class Cancelled(Exception):
|
||||
'''The user cancelled an operation'''
|
||||
pass
|
||||
|
||||
class GajimGeneralException(Exception):
|
||||
'''This exception ir our general exception'''
|
||||
'''This exception is our general exception'''
|
||||
def __init__(self, text=''):
|
||||
Exception.__init__(self)
|
||||
self.text = text
|
||||
|
|
|
@ -2,23 +2,28 @@
|
|||
##
|
||||
## Contributors for this file:
|
||||
##
|
||||
## - Yann Le Boulanger <asterix@lagaule.org>
|
||||
## - Yann Leboulanger <asterix@lagaule.org>
|
||||
## - Christoph Neuroth <delmonico@gmx.net>
|
||||
##
|
||||
## Copyright (C) 2006 Christoph Neuroth <delmonico@gmx.net>
|
||||
## Yann Le Boulanger <asterix@lagaule.org>
|
||||
## Yann Leboulanger <asterix@lagaule.org>
|
||||
## Dimitur Kirov <dkirov@gmail.com>
|
||||
## Travis Shirk <travis@pobox.com>
|
||||
##
|
||||
## 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; version 2 only.
|
||||
## This file is part of Gajim.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## Gajim 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; version 3 only.
|
||||
##
|
||||
## Gajim 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 Gajim. If not, see <http://www.gnu.org/licenses/>.
|
||||
##
|
||||
|
||||
'''
|
||||
Python class to show a "fuzzy clock".
|
||||
|
|
|
@ -1,19 +1,24 @@
|
|||
## common/gajim.py
|
||||
##
|
||||
## Copyright (C) 2003-2006 Yann Le Boulanger <asterix@lagaule.org>
|
||||
## Copyright (C) 2003-2007 Yann Leboulanger <asterix@lagaule.org>
|
||||
## Copyright (C) 2005-2006 Nikos Kouremenos <kourem@gmail.com>
|
||||
## Copyright (C) 2005-2006 Dimitur Kirov <dkirov@gmail.com>
|
||||
## Copyright (C) 2005-2006 Travis Shirk <travis@pobox.com>
|
||||
##
|
||||
## 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; version 2 only.
|
||||
## This file is part of Gajim.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## Gajim 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; version 3 only.
|
||||
##
|
||||
## Gajim 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 Gajim. If not, see <http://www.gnu.org/licenses/>.
|
||||
##
|
||||
|
||||
import sys
|
||||
import logging
|
||||
|
@ -72,6 +77,7 @@ VCARD_PATH = gajimpaths['VCARD']
|
|||
AVATAR_PATH = gajimpaths['AVATAR']
|
||||
MY_EMOTS_PATH = gajimpaths['MY_EMOTS']
|
||||
MY_ICONSETS_PATH = gajimpaths['MY_ICONSETS']
|
||||
MY_CACERTS = gajimpaths['MY_CACERTS']
|
||||
TMP = gajimpaths['TMP']
|
||||
DATA_DIR = gajimpaths['DATA']
|
||||
HOME_DIR = gajimpaths['HOME']
|
||||
|
@ -136,6 +142,18 @@ priority_dict = {}
|
|||
for status in ('online', 'chat', 'away', 'xa', 'dnd', 'invisible'):
|
||||
priority_dict[status] = config.get('autopriority' + status)
|
||||
|
||||
HAVE_PYCRYPTO = True
|
||||
try:
|
||||
import Crypto
|
||||
except ImportError:
|
||||
HAVE_PYCRYPTO = False
|
||||
|
||||
HAVE_PYSEXY = True
|
||||
try:
|
||||
import sexy
|
||||
except ImportError:
|
||||
HAVE_PYSEXY = False
|
||||
|
||||
def get_nick_from_jid(jid):
|
||||
pos = jid.find('@')
|
||||
return jid[:pos]
|
||||
|
|
|
@ -1,21 +1,26 @@
|
|||
## common/helpers.py
|
||||
##
|
||||
## Copyright (C) 2003-2006 Yann Le Boulanger <asterix@lagaule.org>
|
||||
## Copyright (C) 2003-2007 Yann Leboulanger <asterix@lagaule.org>
|
||||
## Copyright (C) 2005-2006 Nikos Kouremenos <kourem@gmail.com>
|
||||
## Copyright (C) 2005
|
||||
## Dimitur Kirov <dkirov@gmail.com>
|
||||
## Copyright (C) 2005 Dimitur Kirov <dkirov@gmail.com>
|
||||
## Travis Shirk <travis@pobox.com>
|
||||
## Copyright (C) 2007 Lukas Petrovicky <lukas@petrovicky.net>
|
||||
## Stephan Erb <steve-e@h3c.de>
|
||||
##
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## This file is part of Gajim.
|
||||
##
|
||||
## Gajim 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; version 2 only.
|
||||
## by the Free Software Foundation; version 3 only.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## Gajim 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 Gajim. If not, see <http://www.gnu.org/licenses/>.
|
||||
##
|
||||
|
||||
import re
|
||||
import locale
|
||||
|
@ -25,6 +30,7 @@ import urllib
|
|||
import errno
|
||||
import select
|
||||
import sha
|
||||
import sys
|
||||
from encodings.punycode import punycode_encode
|
||||
from encodings import idna
|
||||
|
||||
|
@ -34,6 +40,9 @@ from i18n import ngettext
|
|||
from xmpp_stringprep import nodeprep, resourceprep, nameprep
|
||||
|
||||
|
||||
if sys.platform == 'darwin':
|
||||
from osx import nsapp
|
||||
|
||||
try:
|
||||
import winsound # windows-only built-in module for playing wav
|
||||
import win32api
|
||||
|
@ -420,6 +429,9 @@ def launch_browser_mailer(kind, uri):
|
|||
command = 'kfmclient exec'
|
||||
elif gajim.config.get('openwith') == 'exo-open':
|
||||
command = 'exo-open'
|
||||
elif ((sys.platform == 'darwin') and
|
||||
(gajim.config.get('openwith') == 'open')):
|
||||
command = 'open'
|
||||
elif gajim.config.get('openwith') == 'custom':
|
||||
if kind == 'url':
|
||||
command = gajim.config.get('custombrowser')
|
||||
|
@ -447,6 +459,9 @@ def launch_file_manager(path_to_open):
|
|||
command = 'kfmclient exec'
|
||||
elif gajim.config.get('openwith') == 'exo-open':
|
||||
command = 'exo-open'
|
||||
elif ((sys.platform == 'darwin') and
|
||||
(gajim.config.get('openwith') == 'open')):
|
||||
command = 'open'
|
||||
elif gajim.config.get('openwith') == 'custom':
|
||||
command = gajim.config.get('custom_file_manager')
|
||||
if command == '': # if no app is configured
|
||||
|
@ -469,7 +484,9 @@ def play_sound_file(path_to_soundfile):
|
|||
return
|
||||
if path_to_soundfile is None or not os.path.exists(path_to_soundfile):
|
||||
return
|
||||
if os.name == 'nt':
|
||||
if sys.platform == 'darwin':
|
||||
nsapp.playFile(path_to_soundfile)
|
||||
elif os.name == 'nt':
|
||||
try:
|
||||
winsound.PlaySound(path_to_soundfile,
|
||||
winsound.SND_FILENAME|winsound.SND_ASYNC)
|
||||
|
@ -489,6 +506,10 @@ def get_file_path_from_dnd_dropped_uri(uri):
|
|||
if path.startswith('file:\\\\\\'): # windows
|
||||
path = path[8:] # 8 is len('file:///')
|
||||
elif path.startswith('file://'): # nautilus, rox
|
||||
if sys.platform == 'darwin':
|
||||
# OS/X includes hostname in file:// URI
|
||||
path = re.sub('file://[^/]*', '', path)
|
||||
else:
|
||||
path = path[7:] # 7 is len('file://')
|
||||
elif path.startswith('file:'): # xffm
|
||||
path = path[5:] # 5 is len('file:')
|
||||
|
@ -544,6 +565,19 @@ def get_global_status():
|
|||
status = gajim.connections[account].status
|
||||
return status
|
||||
|
||||
def statuses_unified():
|
||||
'''testing if all statuses are the same.'''
|
||||
reference = None
|
||||
for account in gajim.connections:
|
||||
if not gajim.config.get_per('accounts', account,
|
||||
'sync_with_global_status'):
|
||||
continue
|
||||
if reference == None:
|
||||
reference = gajim.connections[account].connected
|
||||
elif reference != gajim.connections[account].connected:
|
||||
return False
|
||||
return True
|
||||
|
||||
def get_icon_name_to_show(contact, account = None):
|
||||
'''Get the icon name to show in online, away, requested, ...'''
|
||||
if account and gajim.events.get_nb_roster_events(account, contact.jid):
|
||||
|
@ -1050,3 +1084,11 @@ def get_iconset_path(iconset):
|
|||
return os.path.join(gajim.DATA_DIR, 'iconsets', iconset)
|
||||
elif os.path.isdir(os.path.join(gajim.MY_ICONSETS_PATH, iconset)):
|
||||
return os.path.join(gajim.MY_ICONSETS_PATH, iconset)
|
||||
|
||||
def get_transport_path(transport):
|
||||
if os.path.isdir(os.path.join(gajim.DATA_DIR, 'iconsets', 'transports',
|
||||
transport)):
|
||||
return os.path.join(gajim.DATA_DIR, 'iconsets', 'transports', transport)
|
||||
elif os.path.isdir(os.path.join(gajim.MY_ICONSETS_PATH, 'transports',
|
||||
transport)):
|
||||
return os.path.join(gajim.MY_ICONSETS_PATH, 'transports', transport)
|
||||
|
|
|
@ -1,27 +1,32 @@
|
|||
## common/i18n.py
|
||||
## -*- coding: utf-8 -*-
|
||||
## Contributors for this file:
|
||||
## - Yann Le Boulanger <asterix@lagaule.org>
|
||||
## - Yann Leboulanger <asterix@lagaule.org>
|
||||
## - Nikos Kouremenos <kourem@gmail.com>
|
||||
##
|
||||
## Copyright (C) 2003-2004 Yann Le Boulanger <asterix@lagaule.org>
|
||||
## Copyright (C) 2003-2004 Yann Leboulanger <asterix@lagaule.org>
|
||||
## Vincent Hanquez <tab@snarc.org>
|
||||
## Copyright (C) 2005 Yann Le Boulanger <asterix@lagaule.org>
|
||||
## Copyright (C) 2005 Yann Leboulanger <asterix@lagaule.org>
|
||||
## Vincent Hanquez <tab@snarc.org>
|
||||
## Nikos Kouremenos <kourem@gmail.com>
|
||||
## Dimitur Kirov <dkirov@gmail.com>
|
||||
## Travis Shirk <travis@pobox.com>
|
||||
## Norman Rasmussen <norman@rasmussen.co.za>
|
||||
##
|
||||
## 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; version 2 only.
|
||||
## This file is part of Gajim.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## Gajim 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; version 3 only.
|
||||
##
|
||||
## Gajim 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 Gajim. If not, see <http://www.gnu.org/licenses/>.
|
||||
##
|
||||
|
||||
import locale
|
||||
import gettext
|
||||
|
|
|
@ -1,17 +1,22 @@
|
|||
## logger.py
|
||||
##
|
||||
## Copyright (C) 2005-2006 Nikos Kouremenos <kourem@gmail.com>
|
||||
## Copyright (C) 2005-2006 Yann Le Boulanger <asterix@lagaule.org>
|
||||
## Copyright (C) 2005-2006 Yann Leboulanger <asterix@lagaule.org>
|
||||
##
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## This file is part of Gajim.
|
||||
##
|
||||
## Gajim 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; version 2 only.
|
||||
## by the Free Software Foundation; version 3 only.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## Gajim 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 Gajim. If not, see <http://www.gnu.org/licenses/>.
|
||||
##
|
||||
|
||||
''' This module allows to access the on-disk database of logs. '''
|
||||
|
||||
|
@ -138,6 +143,9 @@ class Logger:
|
|||
# row[0] is first item of row (the only result here, the jid)
|
||||
self.jids_already_in.append(row[0])
|
||||
|
||||
def get_jids_in_db(self):
|
||||
return self.jids_already_in
|
||||
|
||||
def jid_is_from_pm(self, jid):
|
||||
'''if jid is gajim@conf/nkour it's likely a pm one, how we know
|
||||
gajim@conf is not a normal guy and nkour is not his resource?
|
||||
|
@ -181,7 +189,13 @@ class Logger:
|
|||
typ = constants.JID_ROOM_TYPE
|
||||
else:
|
||||
typ = constants.JID_NORMAL_TYPE
|
||||
self.cur.execute('INSERT INTO jids (jid, type) VALUES (?, ?)', (jid, typ))
|
||||
try:
|
||||
self.cur.execute('INSERT INTO jids (jid, type) VALUES (?, ?)', (jid,
|
||||
typ))
|
||||
except sqlite.IntegrityError, e:
|
||||
# Jid already in DB, maybe added by another instance. re-read DB
|
||||
self.get_jids_already_in_db()
|
||||
return self.get_jid_id(jid, typestr)
|
||||
try:
|
||||
self.con.commit()
|
||||
except sqlite.OperationalError, e:
|
||||
|
|
|
@ -2,15 +2,20 @@
|
|||
##
|
||||
## Copyright (C) 2006 Dimitur Kirov <dkirov@gmail.com>
|
||||
##
|
||||
## 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; version 2 only.
|
||||
## This file is part of Gajim.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## Gajim 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; version 3 only.
|
||||
##
|
||||
## Gajim 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 Gajim. If not, see <http://www.gnu.org/licenses/>.
|
||||
##
|
||||
|
||||
import sys
|
||||
import os
|
||||
|
|
|
@ -1,16 +1,22 @@
|
|||
##
|
||||
## Copyright (C) 2005-2006 Yann Le Boulanger <asterix@lagaule.org>
|
||||
## Copyright (C) 2005-2006 Yann Leboulanger <asterix@lagaule.org>
|
||||
## Copyright (C) 2005-2006 Nikos Kouremenos <kourem@gmail.com>
|
||||
## Copyright (C) 2007 Stephan Erb <steve-e@h3c.de>
|
||||
##
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## This file is part of Gajim.
|
||||
##
|
||||
## Gajim 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; version 2 only.
|
||||
## by the Free Software Foundation; version 3 only.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## Gajim 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 Gajim. If not, see <http://www.gnu.org/licenses/>.
|
||||
##
|
||||
|
||||
import os
|
||||
import locale
|
||||
|
@ -57,9 +63,10 @@ class OptionsParser:
|
|||
if os.path.exists(self.__filename):
|
||||
#we talk about a file
|
||||
print _('error: cannot open %s for reading') % self.__filename
|
||||
return
|
||||
return False
|
||||
|
||||
new_version = gajim.config.get('version')
|
||||
new_version = new_version.split('-', 1)[0]
|
||||
for line in fd.readlines():
|
||||
try:
|
||||
line = line.decode('utf-8')
|
||||
|
@ -67,11 +74,13 @@ class OptionsParser:
|
|||
line = line.decode(locale.getpreferredencoding())
|
||||
self.read_line(line)
|
||||
old_version = gajim.config.get('version')
|
||||
old_version = old_version.split('-', 1)[0]
|
||||
|
||||
self.update_config(old_version, new_version)
|
||||
self.old_values = {} # clean mem
|
||||
|
||||
fd.close()
|
||||
return True
|
||||
|
||||
def write_line(self, fd, opt, parents, value):
|
||||
if value == None:
|
||||
|
@ -163,6 +172,10 @@ class OptionsParser:
|
|||
self.update_config_to_01114()
|
||||
if old < [0, 11, 1, 5] and new >= [0, 11, 1, 5]:
|
||||
self.update_config_to_01115()
|
||||
if old < [0, 11, 2, 1] and new >= [0, 11, 2, 1]:
|
||||
self.update_config_to_01121()
|
||||
if old < [0, 11, 2, 2] and new >= [0, 11, 2, 2]:
|
||||
self.update_config_to_01122()
|
||||
|
||||
gajim.logger.init_vars()
|
||||
gajim.config.set('version', new_version)
|
||||
|
@ -476,3 +489,40 @@ class OptionsParser:
|
|||
pass
|
||||
con.close()
|
||||
gajim.config.set('version', '0.11.1.5')
|
||||
|
||||
def update_config_to_01121(self):
|
||||
# remove old unencrypted secrets file
|
||||
from common.configpaths import gajimpaths
|
||||
|
||||
new_file = gajimpaths['SECRETS_FILE']
|
||||
|
||||
old_file = os.path.dirname(new_file) + '/secrets'
|
||||
|
||||
if os.path.exists(old_file):
|
||||
os.remove(old_file)
|
||||
|
||||
gajim.config.set('version', '0.11.2.1')
|
||||
|
||||
def update_config_to_01122(self):
|
||||
back = os.getcwd()
|
||||
os.chdir(logger.LOG_DB_FOLDER)
|
||||
con = sqlite.connect(logger.LOG_DB_FILE)
|
||||
os.chdir(back)
|
||||
cur = con.cursor()
|
||||
try:
|
||||
cur.executescript(
|
||||
'''
|
||||
CREATE TABLE IF NOT EXISTS caps_cache (
|
||||
node TEXT,
|
||||
ver TEXT,
|
||||
ext TEXT,
|
||||
data BLOB
|
||||
);
|
||||
'''
|
||||
)
|
||||
con.commit()
|
||||
except sqlite.OperationalError, e:
|
||||
pass
|
||||
con.close()
|
||||
gajim.config.set('version', '0.11.2.2')
|
||||
|
||||
|
|
|
@ -2,15 +2,20 @@
|
|||
## Copyright (C) 2006 Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
|
||||
## Copyright (C) 2006 Nikos Kouremenos <kourem@gmail.com>
|
||||
##
|
||||
## 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; version 2 only.
|
||||
## This file is part of Gajim.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## Gajim 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; version 3 only.
|
||||
##
|
||||
## Gajim 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 Gajim. If not, see <http://www.gnu.org/licenses/>.
|
||||
##
|
||||
|
||||
__all__ = ['get_password', 'save_password']
|
||||
|
||||
|
@ -37,6 +42,7 @@ class SimplePasswordStorage(PasswordStorage):
|
|||
|
||||
def save_password(self, account_name, password):
|
||||
gajim.config.set_per('accounts', account_name, 'password', password)
|
||||
if account_name in gajim.connections:
|
||||
gajim.connections[account_name].password = password
|
||||
|
||||
|
||||
|
|
|
@ -4,15 +4,20 @@
|
|||
## Contributors for this file:
|
||||
## - Dimitur Kirov <dkirov@gmail.com>
|
||||
##
|
||||
## 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; version 2 only.
|
||||
## This file is part of Gajim.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## Gajim 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; version 3 only.
|
||||
##
|
||||
## Gajim 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 Gajim. If not, see <http://www.gnu.org/licenses/>.
|
||||
##
|
||||
import socket
|
||||
import struct
|
||||
import errno
|
||||
|
@ -108,9 +113,8 @@ class ProxyResolver:
|
|||
query.setNamespace(common.xmpp.NS_BYTESTREAM)
|
||||
query.setAttr('sid', self.sid)
|
||||
|
||||
query.setTag('activate')
|
||||
# activate = query.setTag('activate')
|
||||
# activate.setData(self.jid + "/" + self.sid)
|
||||
activate = query.setTag('activate')
|
||||
activate.setData(self.jid + "/" + self.sid)
|
||||
|
||||
if self.active_connection:
|
||||
self.active_connection.send(iq)
|
||||
|
@ -253,6 +257,7 @@ class HostTester(Socks5, IdleObject):
|
|||
self._recv=self._sock.recv
|
||||
except Exception, ee:
|
||||
(errnum, errstr) = ee
|
||||
# 56 is for freebsd
|
||||
if errnum in (errno.EINPROGRESS, errno.EALREADY, errno.EWOULDBLOCK):
|
||||
# still trying to connect
|
||||
return
|
||||
|
|
|
@ -1,18 +1,23 @@
|
|||
## rst_xhtml_generator.py
|
||||
##
|
||||
## Copyright (C) 2006 Yann Le Boulanger <asterix@lagaule.org>
|
||||
## Copyright (C) 2006 Yann Leboulanger <asterix@lagaule.org>
|
||||
## Copyright (C) 2006 Nikos Kouremenos <kourem@gmail.com>
|
||||
## Copyright (C) 2006 Santiago Gala
|
||||
##
|
||||
## 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; version 2 only.
|
||||
## This file is part of Gajim.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## Gajim 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; version 3 only.
|
||||
##
|
||||
## Gajim 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 Gajim. If not, see <http://www.gnu.org/licenses/>.
|
||||
##
|
||||
|
||||
try:
|
||||
from docutils import io
|
||||
|
|
|
@ -1,26 +1,31 @@
|
|||
## common/sleepy.py
|
||||
##
|
||||
## Contributors for this file:
|
||||
## - Yann Le Boulanger <asterix@lagaule.org>
|
||||
## - Yann Leboulanger <asterix@lagaule.org>
|
||||
## - Nikos Kouremenos <kourem@gmail.com>
|
||||
##
|
||||
## Copyright (C) 2003-2004 Yann Le Boulanger <asterix@lagaule.org>
|
||||
## Copyright (C) 2003-2004 Yann Leboulanger <asterix@lagaule.org>
|
||||
## Vincent Hanquez <tab@snarc.org>
|
||||
## Copyright (C) 2005-2006 Yann Le Boulanger <asterix@lagaule.org>
|
||||
## Copyright (C) 2005-2006 Yann Leboulanger <asterix@lagaule.org>
|
||||
## Nikos Kouremenos <kourem@gmail.com>
|
||||
##
|
||||
## 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; version 2 only.
|
||||
## This file is part of Gajim.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## Gajim 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; version 3 only.
|
||||
##
|
||||
## Gajim 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 Gajim. If not, see <http://www.gnu.org/licenses/>.
|
||||
##
|
||||
|
||||
from common import gajim
|
||||
import os
|
||||
import os, sys
|
||||
|
||||
|
||||
STATE_UNKNOWN = 'OS probably not supported'
|
||||
|
@ -42,6 +47,8 @@ try:
|
|||
lastInputInfo = LASTINPUTINFO()
|
||||
lastInputInfo.cbSize = ctypes.sizeof(lastInputInfo)
|
||||
|
||||
elif sys.platform == 'darwin':
|
||||
import osx.idle as idle
|
||||
else: # unix
|
||||
import idle
|
||||
except:
|
||||
|
|
|
@ -2,28 +2,33 @@
|
|||
## common/xmpp/socks5.py
|
||||
##
|
||||
## Contributors for this file:
|
||||
## - Yann Le Boulanger <asterix@lagaule.org>
|
||||
## - Yann Leboulanger <asterix@lagaule.org>
|
||||
## - Nikos Kouremenos <kourem@gmail.com>
|
||||
## - Dimitur Kirov <dkirov@gmail.com>
|
||||
##
|
||||
## Copyright (C) 2003-2004 Yann Le Boulanger <asterix@lagaule.org>
|
||||
## Copyright (C) 2003-2004 Yann Leboulanger <asterix@lagaule.org>
|
||||
## Vincent Hanquez <tab@snarc.org>
|
||||
## Copyright (C) 2005 Yann Le Boulanger <asterix@lagaule.org>
|
||||
## Copyright (C) 2005 Yann Leboulanger <asterix@lagaule.org>
|
||||
## Vincent Hanquez <tab@snarc.org>
|
||||
## Nikos Kouremenos <kourem@gmail.com>
|
||||
## Dimitur Kirov <dkirov@gmail.com>
|
||||
## Travis Shirk <travis@pobox.com>
|
||||
## Norman Rasmussen <norman@rasmussen.co.za>
|
||||
##
|
||||
## 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; version 2 only.
|
||||
## This file is part of Gajim.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## Gajim 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; version 3 only.
|
||||
##
|
||||
## Gajim 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 Gajim. If not, see <http://www.gnu.org/licenses/>.
|
||||
##
|
||||
|
||||
|
||||
import socket
|
||||
|
|
|
@ -0,0 +1,910 @@
|
|||
from common import gajim
|
||||
|
||||
from common import xmpp
|
||||
from common import helpers
|
||||
from common import exceptions
|
||||
|
||||
import random
|
||||
import string
|
||||
|
||||
import time
|
||||
|
||||
import xmpp.c14n
|
||||
|
||||
import base64
|
||||
|
||||
XmlDsig = 'http://www.w3.org/2000/09/xmldsig#'
|
||||
|
||||
class StanzaSession(object):
|
||||
def __init__(self, conn, jid, thread_id, type):
|
||||
self.conn = conn
|
||||
|
||||
self.jid = jid
|
||||
|
||||
self.type = type
|
||||
|
||||
if thread_id:
|
||||
self.received_thread_id = True
|
||||
self.thread_id = thread_id
|
||||
else:
|
||||
self.received_thread_id = False
|
||||
if type == 'normal':
|
||||
self.thread_id = None
|
||||
else:
|
||||
self.thread_id = self.generate_thread_id()
|
||||
|
||||
self.last_send = 0
|
||||
self.status = None
|
||||
self.negotiated = {}
|
||||
|
||||
def generate_thread_id(self):
|
||||
return "".join([random.choice(string.ascii_letters) for x in xrange(0,32)])
|
||||
|
||||
def send(self, msg):
|
||||
if self.thread_id:
|
||||
msg.NT.thread = self.thread_id
|
||||
|
||||
msg.setAttr('to', self.jid)
|
||||
self.conn.send_stanza(msg)
|
||||
|
||||
if isinstance(msg, xmpp.Message):
|
||||
self.last_send = time.time()
|
||||
|
||||
def reject_negotiation(self, body = None):
|
||||
msg = xmpp.Message()
|
||||
feature = msg.NT.feature
|
||||
feature.setNamespace(xmpp.NS_FEATURE)
|
||||
|
||||
x = xmpp.DataForm(typ='submit')
|
||||
x.addChild(node=xmpp.DataField(name='FORM_TYPE', value='urn:xmpp:ssn'))
|
||||
x.addChild(node=xmpp.DataField(name='accept', value='0'))
|
||||
|
||||
feature.addChild(node=x)
|
||||
|
||||
if body:
|
||||
msg.setBody(body)
|
||||
|
||||
self.send(msg)
|
||||
|
||||
self.cancelled_negotiation()
|
||||
|
||||
def cancelled_negotiation(self):
|
||||
'''A negotiation has been cancelled, so reset this session to its default state.'''
|
||||
|
||||
if hasattr(self, 'control'):
|
||||
self.control.on_cancel_session_negotiation()
|
||||
|
||||
self.status = None
|
||||
self.negotiated = {}
|
||||
|
||||
def terminate(self):
|
||||
msg = xmpp.Message()
|
||||
feature = msg.NT.feature
|
||||
feature.setNamespace(xmpp.NS_FEATURE)
|
||||
|
||||
x = xmpp.DataForm(typ='submit')
|
||||
x.addChild(node=xmpp.DataField(name='FORM_TYPE', value='urn:xmpp:ssn'))
|
||||
x.addChild(node=xmpp.DataField(name='terminate', value='1'))
|
||||
|
||||
feature.addChild(node=x)
|
||||
|
||||
self.send(msg)
|
||||
|
||||
self.status = None
|
||||
|
||||
def acknowledge_termination(self):
|
||||
# we could send an acknowledgement message to the remote client here
|
||||
self.status = None
|
||||
|
||||
if gajim.HAVE_PYCRYPTO:
|
||||
from Crypto.Cipher import AES
|
||||
from Crypto.Hash import HMAC, SHA256
|
||||
from Crypto.PublicKey import RSA
|
||||
from common import crypto
|
||||
|
||||
from common import dh
|
||||
import secrets
|
||||
|
||||
# an encrypted stanza negotiation has several states. i've represented them
|
||||
# as the following values in the 'status'
|
||||
# attribute of the session object:
|
||||
|
||||
# 1. None:
|
||||
# default state
|
||||
# 2. 'requested-e2e':
|
||||
# this client has initiated an esession negotiation and is waiting
|
||||
# for a response
|
||||
# 3. 'responded-e2e':
|
||||
# this client has responded to an esession negotiation request and
|
||||
# is waiting for the initiator to identify itself and complete the
|
||||
# negotiation
|
||||
# 4. 'identified-alice':
|
||||
# this client identified itself and is waiting for the responder to
|
||||
# identify itself and complete the negotiation
|
||||
# 5. 'active':
|
||||
# an encrypted session has been successfully negotiated. messages
|
||||
# of any of the types listed in 'encryptable_stanzas' should be
|
||||
# encrypted before they're sent.
|
||||
|
||||
# the transition between these states is handled in gajim.py's
|
||||
# handle_session_negotiation method.
|
||||
|
||||
class EncryptedStanzaSession(StanzaSession):
|
||||
def __init__(self, conn, jid, thread_id, type = 'chat'):
|
||||
StanzaSession.__init__(self, conn, jid, thread_id, type = 'chat')
|
||||
|
||||
self.loggable = True
|
||||
|
||||
self.xes = {}
|
||||
self.es = {}
|
||||
|
||||
self.n = 128
|
||||
|
||||
self.enable_encryption = False
|
||||
|
||||
# _s denotes 'self' (ie. this client)
|
||||
self._kc_s = None
|
||||
|
||||
# _o denotes 'other' (ie. the client at the other end of the session)
|
||||
self._kc_o = None
|
||||
|
||||
# keep the encrypter updated with my latest cipher key
|
||||
def set_kc_s(self, value):
|
||||
self._kc_s = value
|
||||
self.encrypter = self.cipher.new(self._kc_s, self.cipher.MODE_CTR,
|
||||
counter=self.encryptcounter)
|
||||
|
||||
def get_kc_s(self):
|
||||
return self._kc_s
|
||||
|
||||
# keep the decrypter updated with the other party's latest cipher key
|
||||
def set_kc_o(self, value):
|
||||
self._kc_o = value
|
||||
self.decrypter = self.cipher.new(self._kc_o, self.cipher.MODE_CTR,
|
||||
counter=self.decryptcounter)
|
||||
|
||||
def get_kc_o(self):
|
||||
return self._kc_o
|
||||
|
||||
kc_s = property(get_kc_s, set_kc_s)
|
||||
kc_o = property(get_kc_o, set_kc_o)
|
||||
|
||||
def encryptcounter(self):
|
||||
self.c_s = (self.c_s + 1) % (2 ** self.n)
|
||||
return crypto.encode_mpi_with_padding(self.c_s)
|
||||
|
||||
def decryptcounter(self):
|
||||
self.c_o = (self.c_o + 1) % (2 ** self.n)
|
||||
return crypto.encode_mpi_with_padding(self.c_o)
|
||||
|
||||
def sign(self, string):
|
||||
if self.negotiated['sign_algs'] == (XmlDsig + 'rsa-sha256'):
|
||||
hash = crypto.sha256(string)
|
||||
return crypto.encode_mpi(gajim.pubkey.sign(hash, '')[0])
|
||||
|
||||
def encrypt_stanza(self, stanza):
|
||||
encryptable = filter(lambda x: x.getName() not in ('error', 'amp',
|
||||
'thread'), stanza.getChildren())
|
||||
|
||||
# XXX can also encrypt contents of <error/> elements in stanzas @type =
|
||||
# 'error'
|
||||
# (except for <defined-condition
|
||||
# xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> child elements)
|
||||
|
||||
old_en_counter = self.c_s
|
||||
|
||||
for element in encryptable:
|
||||
stanza.delChild(element)
|
||||
|
||||
plaintext = ''.join(map(str, encryptable))
|
||||
|
||||
m_compressed = self.compress(plaintext)
|
||||
m_final = self.encrypt(m_compressed)
|
||||
|
||||
c = stanza.NT.c
|
||||
c.setNamespace('http://www.xmpp.org/extensions/xep-0200.html#ns')
|
||||
c.NT.data = base64.b64encode(m_final)
|
||||
|
||||
# XXX check for rekey request, handle <key/> elements
|
||||
|
||||
m_content = ''.join(map(str, c.getChildren()))
|
||||
c.NT.mac = base64.b64encode(self.hmac(self.km_s, m_content + \
|
||||
crypto.encode_mpi(old_en_counter)))
|
||||
|
||||
return stanza
|
||||
|
||||
def hmac(self, key, content):
|
||||
return HMAC.new(key, content, self.hash_alg).digest()
|
||||
|
||||
def generate_initiator_keys(self, k):
|
||||
return (self.hmac(k, 'Initiator Cipher Key'),
|
||||
self.hmac(k, 'Initiator MAC Key'),
|
||||
self.hmac(k, 'Initiator SIGMA Key') )
|
||||
|
||||
def generate_responder_keys(self, k):
|
||||
return (self.hmac(k, 'Responder Cipher Key'),
|
||||
self.hmac(k, 'Responder MAC Key'),
|
||||
self.hmac(k, 'Responder SIGMA Key') )
|
||||
|
||||
def compress(self, plaintext):
|
||||
if self.compression == None:
|
||||
return plaintext
|
||||
|
||||
def decompress(self, compressed):
|
||||
if self.compression == None:
|
||||
return compressed
|
||||
|
||||
def encrypt(self, encryptable):
|
||||
padded = crypto.pad_to_multiple(encryptable, 16, ' ', False)
|
||||
|
||||
return self.encrypter.encrypt(padded)
|
||||
|
||||
def decrypt_stanza(self, stanza):
|
||||
c = stanza.getTag(name='c',
|
||||
namespace='http://www.xmpp.org/extensions/xep-0200.html#ns')
|
||||
|
||||
stanza.delChild(c)
|
||||
|
||||
# contents of <c>, minus <mac>, minus whitespace
|
||||
macable = ''.join(map(str, filter(lambda x: x.getName() != 'mac',
|
||||
c.getChildren())))
|
||||
|
||||
received_mac = base64.b64decode(c.getTagData('mac'))
|
||||
calculated_mac = self.hmac(self.km_o, macable + \
|
||||
crypto.encode_mpi_with_padding(self.c_o))
|
||||
|
||||
if not calculated_mac == received_mac:
|
||||
raise exceptions.DecryptionError, 'bad signature'
|
||||
|
||||
m_final = base64.b64decode(c.getTagData('data'))
|
||||
m_compressed = self.decrypt(m_final)
|
||||
plaintext = self.decompress(m_compressed)
|
||||
|
||||
try:
|
||||
parsed = xmpp.Node(node='<node>' + plaintext + '</node>')
|
||||
except:
|
||||
raise exceptions.DecryptionError, 'decrypted <data/> not parseable as XML'
|
||||
|
||||
for child in parsed.getChildren():
|
||||
stanza.addChild(node=child)
|
||||
|
||||
return stanza
|
||||
|
||||
def decrypt(self, ciphertext):
|
||||
return self.decrypter.decrypt(ciphertext)
|
||||
|
||||
def logging_preference(self):
|
||||
if gajim.config.get('log_encrypted_sessions'):
|
||||
return ["may", "mustnot"]
|
||||
else:
|
||||
return ["mustnot", "may"]
|
||||
|
||||
def get_shared_secret(self, e, y, p):
|
||||
if (not 1 < e < (p - 1)):
|
||||
raise exceptions.NegotiationError, "invalid DH value"
|
||||
|
||||
return crypto.sha256(crypto.encode_mpi(crypto.powmod(e, y, p)))
|
||||
|
||||
def c7lize_mac_id(self, form):
|
||||
kids = form.getChildren()
|
||||
macable = filter(lambda x: x.getVar() not in ('mac', 'identity'), kids)
|
||||
return ''.join(map(lambda el: xmpp.c14n.c14n(el), macable))
|
||||
|
||||
def verify_identity(self, form, dh_i, sigmai, i_o):
|
||||
m_o = base64.b64decode(form['mac'])
|
||||
id_o = base64.b64decode(form['identity'])
|
||||
|
||||
m_o_calculated = self.hmac(self.km_o, crypto.encode_mpi(self.c_o) + id_o)
|
||||
|
||||
if m_o_calculated != m_o:
|
||||
raise exceptions.NegotiationError, 'calculated m_%s differs from received m_%s' % (i_o, i_o)
|
||||
|
||||
if i_o == 'a' and self.sas_algs == 'sas28x5':
|
||||
# XXX not necessary if there's a verified retained secret
|
||||
self.sas = crypto.sas_28x5(m_o, self.form_s)
|
||||
|
||||
if self.negotiated['recv_pubkey']:
|
||||
plaintext = self.decrypt(id_o)
|
||||
parsed = xmpp.Node(node='<node>' + plaintext + '</node>')
|
||||
|
||||
if self.negotiated['recv_pubkey'] == 'hash':
|
||||
fingerprint = parsed.getTagData('fingerprint')
|
||||
|
||||
# XXX find stored pubkey or terminate session
|
||||
raise 'unimplemented'
|
||||
else:
|
||||
if self.negotiated['sign_algs'] == (XmlDsig + 'rsa-sha256'):
|
||||
keyvalue = parsed.getTag(name='RSAKeyValue', namespace=XmlDsig)
|
||||
|
||||
n, e = map(lambda x: crypto.decode_mpi(base64.b64decode(
|
||||
keyvalue.getTagData(x))), ('Modulus', 'Exponent'))
|
||||
eir_pubkey = RSA.construct((n,long(e)))
|
||||
|
||||
pubkey_o = xmpp.c14n.c14n(keyvalue)
|
||||
else:
|
||||
# XXX DSA, etc.
|
||||
raise 'unimplemented'
|
||||
|
||||
enc_sig = parsed.getTag(name='SignatureValue',
|
||||
namespace=XmlDsig).getData()
|
||||
signature = (crypto.decode_mpi(base64.b64decode(enc_sig)),)
|
||||
else:
|
||||
mac_o = self.decrypt(id_o)
|
||||
pubkey_o = ''
|
||||
|
||||
c7l_form = self.c7lize_mac_id(form)
|
||||
|
||||
content = self.n_s + self.n_o + crypto.encode_mpi(dh_i) + pubkey_o
|
||||
|
||||
if sigmai:
|
||||
self.form_o = c7l_form
|
||||
content += self.form_o
|
||||
else:
|
||||
form_o2 = c7l_form
|
||||
content += self.form_o + form_o2
|
||||
|
||||
mac_o_calculated = self.hmac(self.ks_o, content)
|
||||
|
||||
if self.negotiated['recv_pubkey']:
|
||||
hash = crypto.sha256(mac_o_calculated)
|
||||
|
||||
if not eir_pubkey.verify(hash, signature):
|
||||
raise exceptions.NegotiationError, 'public key signature verification failed!'
|
||||
|
||||
elif mac_o_calculated != mac_o:
|
||||
raise exceptions.NegotiationError, 'calculated mac_%s differs from received mac_%s' % (i_o, i_o)
|
||||
|
||||
def make_identity(self, form, dh_i):
|
||||
if self.negotiated['send_pubkey']:
|
||||
if self.negotiated['sign_algs'] == (XmlDsig + 'rsa-sha256'):
|
||||
pubkey = secrets.secrets().my_pubkey(self.conn.name)
|
||||
fields = (pubkey.n, pubkey.e)
|
||||
|
||||
cb_fields = map(lambda f: base64.b64encode(crypto.encode_mpi(f)), fields)
|
||||
|
||||
pubkey_s = '<RSAKeyValue xmlns="http://www.w3.org/2000/09/xmldsig#"><Modulus>%s</Modulus><Exponent>%s</Exponent></RSAKeyValue>' % tuple(cb_fields)
|
||||
else:
|
||||
pubkey_s = ''
|
||||
|
||||
form_s2 = ''.join(map(lambda el: xmpp.c14n.c14n(el), form.getChildren()))
|
||||
|
||||
old_c_s = self.c_s
|
||||
content = self.n_o + self.n_s + crypto.encode_mpi(dh_i) + pubkey_s + self.form_s + form_s2
|
||||
|
||||
mac_s = self.hmac(self.ks_s, content)
|
||||
|
||||
if self.negotiated['send_pubkey']:
|
||||
signature = self.sign(mac_s)
|
||||
|
||||
sign_s = '<SignatureValue xmlns="http://www.w3.org/2000/09/xmldsig#">%s</SignatureValue>' % base64.b64encode(signature)
|
||||
|
||||
if self.negotiated['send_pubkey'] == 'hash':
|
||||
b64ed = base64.b64encode(self.hash(pubkey_s))
|
||||
pubkey_s = '<fingerprint>%s</fingerprint>' % b64ed
|
||||
|
||||
id_s = self.encrypt(pubkey_s + sign_s)
|
||||
else:
|
||||
id_s = self.encrypt(mac_s)
|
||||
|
||||
m_s = self.hmac(self.km_s, crypto.encode_mpi(old_c_s) + id_s)
|
||||
|
||||
if self.status == 'requested-e2e' and self.sas_algs == 'sas28x5':
|
||||
# we're alice; check for a retained secret
|
||||
# if none exists, prompt the user with the SAS
|
||||
self.sas = crypto.sas_28x5(m_s, self.form_o)
|
||||
|
||||
if self.sigmai:
|
||||
# XXX save retained secret?
|
||||
self.check_identity(lambda : ())
|
||||
|
||||
return (xmpp.DataField(name='identity', value=base64.b64encode(id_s)), \
|
||||
xmpp.DataField(name='mac', value=base64.b64encode(m_s)))
|
||||
|
||||
def negotiate_e2e(self, sigmai):
|
||||
self.negotiated = {}
|
||||
|
||||
request = xmpp.Message()
|
||||
feature = request.NT.feature
|
||||
feature.setNamespace(xmpp.NS_FEATURE)
|
||||
|
||||
x = xmpp.DataForm(typ='form')
|
||||
|
||||
x.addChild(node=xmpp.DataField(name='FORM_TYPE', value='urn:xmpp:ssn', typ='hidden'))
|
||||
x.addChild(node=xmpp.DataField(name='accept', value='1', typ='boolean', required=True))
|
||||
|
||||
# this field is incorrectly called 'otr' in XEPs 0116 and 0217
|
||||
x.addChild(node=xmpp.DataField(name='logging', typ='list-single', options=self.logging_preference(), required=True))
|
||||
|
||||
# unsupported options: 'disabled', 'enabled'
|
||||
x.addChild(node=xmpp.DataField(name='disclosure', typ='list-single', options=['never'], required=True))
|
||||
x.addChild(node=xmpp.DataField(name='security', typ='list-single', options=['e2e'], required=True))
|
||||
x.addChild(node=xmpp.DataField(name='crypt_algs', value='aes128-ctr', typ='hidden'))
|
||||
x.addChild(node=xmpp.DataField(name='hash_algs', value='sha256', typ='hidden'))
|
||||
x.addChild(node=xmpp.DataField(name='compress', value='none', typ='hidden'))
|
||||
|
||||
# unsupported options: 'iq', 'presence'
|
||||
x.addChild(node=xmpp.DataField(name='stanzas', typ='list-multi', options=['message']))
|
||||
|
||||
x.addChild(node=xmpp.DataField(name='init_pubkey', options=['none', 'key', 'hash'], typ='list-single'))
|
||||
|
||||
# XXX store key, use hash
|
||||
x.addChild(node=xmpp.DataField(name='resp_pubkey', options=['none', 'key'], typ='list-single'))
|
||||
|
||||
x.addChild(node=xmpp.DataField(name='ver', value='1.0', typ='hidden'))
|
||||
|
||||
x.addChild(node=xmpp.DataField(name='rekey_freq', value='4294967295', typ='hidden'))
|
||||
|
||||
x.addChild(node=xmpp.DataField(name='sas_algs', value='sas28x5', typ='hidden'))
|
||||
x.addChild(node=xmpp.DataField(name='sign_algs', value='http://www.w3.org/2000/09/xmldsig#rsa-sha256', typ='hidden'))
|
||||
|
||||
self.n_s = crypto.generate_nonce()
|
||||
|
||||
x.addChild(node=xmpp.DataField(name='my_nonce', value=base64.b64encode(self.n_s), typ='hidden'))
|
||||
|
||||
modp_options = [ 5, 14, 2, 1 ]
|
||||
|
||||
x.addChild(node=xmpp.DataField(name='modp', typ='list-single', options=map(lambda x: [ None, x ], modp_options)))
|
||||
|
||||
x.addChild(node=self.make_dhfield(modp_options, sigmai))
|
||||
self.sigmai = sigmai
|
||||
|
||||
self.form_s = ''.join(map(lambda el: xmpp.c14n.c14n(el), x.getChildren()))
|
||||
|
||||
feature.addChild(node=x)
|
||||
|
||||
self.status = 'requested-e2e'
|
||||
|
||||
self.send(request)
|
||||
|
||||
# 4.3 esession response (bob)
|
||||
def verify_options_bob(self, form):
|
||||
negotiated = {'recv_pubkey': None, 'send_pubkey': None}
|
||||
not_acceptable = []
|
||||
ask_user = {}
|
||||
|
||||
fixed = { 'disclosure': 'never',
|
||||
'security': 'e2e',
|
||||
'crypt_algs': 'aes128-ctr',
|
||||
'hash_algs': 'sha256',
|
||||
'compress': 'none',
|
||||
'stanzas': 'message',
|
||||
'init_pubkey': 'none',
|
||||
'resp_pubkey': 'none',
|
||||
'ver': '1.0',
|
||||
'sas_algs': 'sas28x5' }
|
||||
|
||||
self.encryptable_stanzas = ['message']
|
||||
|
||||
self.sas_algs = 'sas28x5'
|
||||
self.cipher = AES
|
||||
self.hash_alg = SHA256
|
||||
self.compression = None
|
||||
|
||||
for name, field in map(lambda name: (name, form.getField(name)), form.asDict().keys()):
|
||||
options = map(lambda x: x[1], field.getOptions())
|
||||
values = field.getValues()
|
||||
|
||||
if not field.getType() in ('list-single', 'list-multi'):
|
||||
options = values
|
||||
|
||||
if name in fixed:
|
||||
if fixed[name] in options:
|
||||
negotiated[name] = fixed[name]
|
||||
else:
|
||||
not_acceptable.append(name)
|
||||
elif name == 'rekey_freq':
|
||||
preferred = int(options[0])
|
||||
negotiated['rekey_freq'] = preferred
|
||||
self.rekey_freq = preferred
|
||||
elif name == 'logging':
|
||||
my_prefs = self.logging_preference()
|
||||
|
||||
if my_prefs[0] in options: # our first choice is offered, select it
|
||||
pref = my_prefs[0]
|
||||
negotiated['logging'] = pref
|
||||
else: # see if other acceptable choices are offered
|
||||
for pref in my_prefs:
|
||||
if pref in options:
|
||||
ask_user['logging'] = pref
|
||||
break
|
||||
|
||||
if not 'logging' in ask_user:
|
||||
not_acceptable.append(name)
|
||||
elif name == 'init_pubkey':
|
||||
for x in ('key'):
|
||||
if x in options:
|
||||
negotiated['recv_pubkey'] = x
|
||||
break
|
||||
elif name == 'resp_pubkey':
|
||||
for x in ('hash', 'key'):
|
||||
if x in options:
|
||||
negotiated['send_pubkey'] = x
|
||||
break
|
||||
elif name == 'sign_algs':
|
||||
if (XmlDsig + 'rsa-sha256') in options:
|
||||
negotiated['sign_algs'] = XmlDsig + 'rsa-sha256'
|
||||
else:
|
||||
# XXX some things are handled elsewhere, some things are not-implemented
|
||||
pass
|
||||
|
||||
return (negotiated, not_acceptable, ask_user)
|
||||
|
||||
# 4.3 esession response (bob)
|
||||
def respond_e2e_bob(self, form, negotiated, not_acceptable):
|
||||
response = xmpp.Message()
|
||||
feature = response.NT.feature
|
||||
feature.setNamespace(xmpp.NS_FEATURE)
|
||||
|
||||
x = xmpp.DataForm(typ='submit')
|
||||
|
||||
x.addChild(node=xmpp.DataField(name='FORM_TYPE', value='urn:xmpp:ssn'))
|
||||
x.addChild(node=xmpp.DataField(name='accept', value='true'))
|
||||
|
||||
for name in negotiated:
|
||||
# some fields are internal and should not be sent
|
||||
if not name in ('send_pubkey', 'recv_pubkey'):
|
||||
x.addChild(node=xmpp.DataField(name=name, value=negotiated[name]))
|
||||
|
||||
self.negotiated = negotiated
|
||||
|
||||
# the offset of the group we chose (need it to match up with the dhhash)
|
||||
group_order = 0
|
||||
self.modp = int(form.getField('modp').getOptions()[group_order][1])
|
||||
x.addChild(node=xmpp.DataField(name='modp', value=self.modp))
|
||||
|
||||
g = dh.generators[self.modp]
|
||||
p = dh.primes[self.modp]
|
||||
|
||||
self.n_o = base64.b64decode(form['my_nonce'])
|
||||
|
||||
dhhashes = form.getField('dhhashes').getValues()
|
||||
self.negotiated['He'] = base64.b64decode(dhhashes[group_order].encode("utf8"))
|
||||
|
||||
bytes = int(self.n / 8)
|
||||
|
||||
self.n_s = crypto.generate_nonce()
|
||||
|
||||
self.c_o = crypto.decode_mpi(crypto.random_bytes(bytes)) # n-bit random number
|
||||
self.c_s = self.c_o ^ (2 ** (self.n - 1))
|
||||
|
||||
self.y = crypto.srand(2 ** (2 * self.n - 1), p - 1)
|
||||
self.d = crypto.powmod(g, self.y, p)
|
||||
|
||||
to_add = { 'my_nonce': self.n_s,
|
||||
'dhkeys': crypto.encode_mpi(self.d),
|
||||
'counter': crypto.encode_mpi(self.c_o),
|
||||
'nonce': self.n_o }
|
||||
|
||||
for name in to_add:
|
||||
b64ed = base64.b64encode(to_add[name])
|
||||
x.addChild(node=xmpp.DataField(name=name, value=b64ed))
|
||||
|
||||
self.form_o = ''.join(map(lambda el: xmpp.c14n.c14n(el), form.getChildren()))
|
||||
self.form_s = ''.join(map(lambda el: xmpp.c14n.c14n(el), x.getChildren()))
|
||||
|
||||
self.status = 'responded-e2e'
|
||||
|
||||
feature.addChild(node=x)
|
||||
|
||||
if not_acceptable:
|
||||
response = xmpp.Error(response, xmpp.ERR_NOT_ACCEPTABLE)
|
||||
|
||||
feature = xmpp.Node(xmpp.NS_FEATURE + ' feature')
|
||||
|
||||
for f in not_acceptable:
|
||||
n = xmpp.Node('field')
|
||||
n['var'] = f
|
||||
feature.addChild(node=n)
|
||||
|
||||
response.T.error.addChild(node=feature)
|
||||
|
||||
self.send(response)
|
||||
|
||||
# 'Alice Accepts'
|
||||
def verify_options_alice(self, form):
|
||||
negotiated = {}
|
||||
ask_user = {}
|
||||
not_acceptable = []
|
||||
|
||||
if not form['logging'] in self.logging_preference():
|
||||
not_acceptable.append(form['logging'])
|
||||
elif form['logging'] != self.logging_preference()[0]:
|
||||
ask_user['logging'] = form['logging']
|
||||
else:
|
||||
negotiated['logging'] = self.logging_preference()[0]
|
||||
|
||||
for r,a in (('recv_pubkey', 'resp_pubkey'), ('send_pubkey', 'init_pubkey')):
|
||||
negotiated[r] = None
|
||||
|
||||
if a in form.asDict() and form[a] in ('key', 'hash'):
|
||||
negotiated[r] = form[a]
|
||||
|
||||
if 'sign_algs' in form.asDict():
|
||||
if form['sign_algs'] in (XmlDsig + 'rsa-sha256',):
|
||||
negotiated['sign_algs'] = form['sign_algs']
|
||||
else:
|
||||
not_acceptable.append(form['sign_algs'])
|
||||
|
||||
return (negotiated, not_acceptable, ask_user)
|
||||
|
||||
# 'Alice Accepts', continued
|
||||
def accept_e2e_alice(self, form, negotiated):
|
||||
self.encryptable_stanzas = ['message']
|
||||
self.sas_algs = 'sas28x5'
|
||||
self.cipher = AES
|
||||
self.hash_alg = SHA256
|
||||
self.compression = None
|
||||
|
||||
self.negotiated = negotiated
|
||||
|
||||
accept = xmpp.Message()
|
||||
feature = accept.NT.feature
|
||||
feature.setNamespace(xmpp.NS_FEATURE)
|
||||
|
||||
result = xmpp.DataForm(typ='result')
|
||||
|
||||
self.c_s = crypto.decode_mpi(base64.b64decode(form['counter']))
|
||||
self.c_o = self.c_s ^ (2 ** (self.n - 1))
|
||||
|
||||
self.n_o = base64.b64decode(form['my_nonce'])
|
||||
|
||||
mod_p = int(form['modp'])
|
||||
p = dh.primes[mod_p]
|
||||
x = self.xes[mod_p]
|
||||
e = self.es[mod_p]
|
||||
|
||||
self.d = crypto.decode_mpi(base64.b64decode(form['dhkeys']))
|
||||
|
||||
self.k = self.get_shared_secret(self.d, x, p)
|
||||
|
||||
result.addChild(node=xmpp.DataField(name='FORM_TYPE', value='urn:xmpp:ssn'))
|
||||
result.addChild(node=xmpp.DataField(name='accept', value='1'))
|
||||
result.addChild(node=xmpp.DataField(name='nonce', value=base64.b64encode(self.n_o)))
|
||||
|
||||
self.kc_s, self.km_s, self.ks_s = self.generate_initiator_keys(self.k)
|
||||
|
||||
if self.sigmai:
|
||||
self.kc_o, self.km_o, self.ks_o = self.generate_responder_keys(self.k)
|
||||
self.verify_identity(form, self.d, True, 'b')
|
||||
else:
|
||||
srses = secrets.secrets().retained_secrets(self.conn.name, self.jid.getStripped())
|
||||
rshashes = [self.hmac(self.n_s, rs) for (rs,v) in srses]
|
||||
|
||||
if not rshashes:
|
||||
# we've never spoken before, but we'll pretend we have
|
||||
rshash_size = self.hash_alg.digest_size
|
||||
rshashes.append(crypto.random_bytes(rshash_size))
|
||||
|
||||
rshashes = [base64.b64encode(rshash) for rshash in rshashes]
|
||||
result.addChild(node=xmpp.DataField(name='rshashes', value=rshashes))
|
||||
result.addChild(node=xmpp.DataField(name='dhkeys', value=base64.b64encode(crypto.encode_mpi(e))))
|
||||
|
||||
self.form_o = ''.join(map(lambda el: xmpp.c14n.c14n(el), form.getChildren()))
|
||||
|
||||
# MUST securely destroy K unless it will be used later to generate the final shared secret
|
||||
|
||||
for datafield in self.make_identity(result, e):
|
||||
result.addChild(node=datafield)
|
||||
|
||||
feature.addChild(node=result)
|
||||
self.send(accept)
|
||||
|
||||
if self.sigmai:
|
||||
self.status = 'active'
|
||||
self.enable_encryption = True
|
||||
else:
|
||||
self.status = 'identified-alice'
|
||||
|
||||
# 4.5 esession accept (bob)
|
||||
def accept_e2e_bob(self, form):
|
||||
response = xmpp.Message()
|
||||
|
||||
init = response.NT.init
|
||||
init.setNamespace(xmpp.NS_ESESSION_INIT)
|
||||
|
||||
x = xmpp.DataForm(typ='result')
|
||||
|
||||
for field in ('nonce', 'dhkeys', 'rshashes', 'identity', 'mac'):
|
||||
assert field in form.asDict(), "alice's form didn't have a %s field" % field
|
||||
|
||||
# 4.5.1 generating provisory session keys
|
||||
e = crypto.decode_mpi(base64.b64decode(form['dhkeys']))
|
||||
p = dh.primes[self.modp]
|
||||
|
||||
if crypto.sha256(crypto.encode_mpi(e)) != self.negotiated['He']:
|
||||
raise exceptions.NegotiationError, 'SHA256(e) != He'
|
||||
|
||||
k = self.get_shared_secret(e, self.y, p)
|
||||
|
||||
self.kc_o, self.km_o, self.ks_o = self.generate_initiator_keys(k)
|
||||
|
||||
# 4.5.2 verifying alice's identity
|
||||
|
||||
self.verify_identity(form, e, False, 'a')
|
||||
|
||||
# 4.5.4 generating bob's final session keys
|
||||
|
||||
srs = ''
|
||||
|
||||
srses = secrets.secrets().retained_secrets(self.conn.name, self.jid.getStripped())
|
||||
rshashes = [base64.b64decode(rshash) for rshash in form.getField('rshashes').getValues()]
|
||||
|
||||
for (secret, verified) in srses:
|
||||
if self.hmac(self.n_o, secret) in rshashes:
|
||||
srs = secret
|
||||
break
|
||||
|
||||
# other shared secret
|
||||
# (we're not using one)
|
||||
oss = ''
|
||||
|
||||
k = crypto.sha256(k + srs + oss)
|
||||
|
||||
self.kc_s, self.km_s, self.ks_s = self.generate_responder_keys(k)
|
||||
self.kc_o, self.km_o, self.ks_o = self.generate_initiator_keys(k)
|
||||
|
||||
# 4.5.5
|
||||
if srs:
|
||||
srshash = self.hmac(srs, 'Shared Retained Secret')
|
||||
else:
|
||||
srshash = crypto.random_bytes(32)
|
||||
|
||||
x.addChild(node=xmpp.DataField(name='FORM_TYPE', value='urn:xmpp:ssn'))
|
||||
x.addChild(node=xmpp.DataField(name='nonce', value=base64.b64encode(self.n_o)))
|
||||
x.addChild(node=xmpp.DataField(name='srshash', value=base64.b64encode(srshash)))
|
||||
|
||||
for datafield in self.make_identity(x, self.d):
|
||||
x.addChild(node=datafield)
|
||||
|
||||
init.addChild(node=x)
|
||||
|
||||
self.send(response)
|
||||
|
||||
self.do_retained_secret(k, srs)
|
||||
|
||||
if self.negotiated['logging'] == 'mustnot':
|
||||
self.loggable = False
|
||||
|
||||
self.status = 'active'
|
||||
self.enable_encryption = True
|
||||
|
||||
if hasattr(self, 'control'):
|
||||
self.control.print_esession_details()
|
||||
|
||||
def final_steps_alice(self, form):
|
||||
srs = ''
|
||||
srses = secrets.secrets().retained_secrets(self.conn.name, self.jid.getStripped())
|
||||
|
||||
srshash = base64.b64decode(form['srshash'])
|
||||
|
||||
for (secret, verified) in srses:
|
||||
if self.hmac(secret, 'Shared Retained Secret') == srshash:
|
||||
srs = secret
|
||||
break
|
||||
|
||||
oss = ''
|
||||
k = crypto.sha256(self.k + srs + oss)
|
||||
del self.k
|
||||
|
||||
self.do_retained_secret(k, srs)
|
||||
|
||||
# don't need to calculate ks_s here
|
||||
|
||||
self.kc_s, self.km_s, self.ks_s = self.generate_initiator_keys(k)
|
||||
self.kc_o, self.km_o, self.ks_o = self.generate_responder_keys(k)
|
||||
|
||||
# 4.6.2 Verifying Bob's Identity
|
||||
|
||||
self.verify_identity(form, self.d, False, 'b')
|
||||
# Note: If Alice discovers an error then she SHOULD ignore any encrypted content she received in the stanza.
|
||||
|
||||
if self.negotiated['logging'] == 'mustnot':
|
||||
self.loggable = False
|
||||
|
||||
self.status = 'active'
|
||||
self.enable_encryption = True
|
||||
|
||||
if hasattr(self, 'control'):
|
||||
self.control.print_esession_details()
|
||||
|
||||
# calculate and store the new retained secret
|
||||
# prompt the user to check the remote party's identity (if necessary)
|
||||
def do_retained_secret(self, k, srs):
|
||||
new_srs = self.hmac(k, 'New Retained Secret')
|
||||
account = self.conn.name
|
||||
bjid = self.jid.getStripped()
|
||||
|
||||
if srs:
|
||||
if secrets.secrets().srs_verified(account, bjid, srs):
|
||||
secrets.secrets().replace_srs(account, bjid, srs, new_srs, True)
|
||||
else:
|
||||
def _cb(verified):
|
||||
secrets.secrets().replace_srs(account, bjid, srs, new_srs, verified)
|
||||
|
||||
self.check_identity(_cb)
|
||||
else:
|
||||
def _cb(verified):
|
||||
secrets.secrets().save_new_srs(account, bjid, new_srs, verified)
|
||||
|
||||
self.check_identity(_cb)
|
||||
|
||||
def make_dhfield(self, modp_options, sigmai):
|
||||
dhs = []
|
||||
|
||||
for modp in modp_options:
|
||||
p = dh.primes[modp]
|
||||
g = dh.generators[modp]
|
||||
|
||||
x = crypto.srand(2 ** (2 * self.n - 1), p - 1)
|
||||
|
||||
# XXX this may be a source of performance issues
|
||||
e = crypto.powmod(g, x, p)
|
||||
|
||||
self.xes[modp] = x
|
||||
self.es[modp] = e
|
||||
|
||||
if sigmai:
|
||||
dhs.append(base64.b64encode(crypto.encode_mpi(e)))
|
||||
name = 'dhkeys'
|
||||
else:
|
||||
He = crypto.sha256(crypto.encode_mpi(e))
|
||||
dhs.append(base64.b64encode(He))
|
||||
name = 'dhhashes'
|
||||
|
||||
return xmpp.DataField(name=name, typ='hidden', value=dhs)
|
||||
|
||||
def terminate_e2e(self):
|
||||
self.terminate()
|
||||
|
||||
self.enable_encryption = False
|
||||
|
||||
def acknowledge_termination(self):
|
||||
StanzaSession.acknowledge_termination(self)
|
||||
|
||||
self.enable_encryption = False
|
||||
|
||||
def fail_bad_negotiation(self, reason, fields = None):
|
||||
'''sends an error and cancels everything.
|
||||
|
||||
if fields == None, the remote party has given us a bad cryptographic value of some kind
|
||||
|
||||
otherwise, list the fields we haven't implemented'''
|
||||
|
||||
err = xmpp.Error(xmpp.Message(), xmpp.ERR_FEATURE_NOT_IMPLEMENTED)
|
||||
err.T.error.T.text.setData(reason)
|
||||
|
||||
if fields:
|
||||
feature = xmpp.Node(xmpp.NS_FEATURE + ' feature')
|
||||
|
||||
for field in fields:
|
||||
fn = xmpp.Node('field')
|
||||
fn['var'] = field
|
||||
feature.addChild(node=feature)
|
||||
|
||||
err.addChild(node=feature)
|
||||
|
||||
self.send(err)
|
||||
|
||||
self.status = None
|
||||
self.enable_encryption = False
|
||||
|
||||
# this prevents the MAC check on decryption from succeeding,
|
||||
# preventing falsified messages from going through.
|
||||
self.km_o = ''
|
||||
|
||||
def is_loggable(self):
|
||||
account = self.conn.name
|
||||
no_log_for = gajim.config.get_per('accounts', account, 'no_log_for')
|
||||
|
||||
if not no_log_for:
|
||||
no_log_for = ''
|
||||
|
||||
no_log_for = no_log_for.split()
|
||||
|
||||
return self.loggable and account not in no_log_for and self.jid not in no_log_for
|
||||
|
||||
def cancelled_negotiation(self):
|
||||
StanzaSession.cancelled_negotiation(self)
|
||||
self.enable_encryption = False
|
||||
|
||||
self.km_o = ''
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue