Mon, 24 Nov 2008 00:40:57 +0000
Prevent the Buddy State Notification plugin from printing duplicate
notifications when the same buddy is in multiple groups on protocols which
support it. Also prevent autolinkification of JID's, MSN passport addresses,
etc. in the notification messages. Fixes #7609.
committer: John Bailey <rekkanoryo@rekkanoryo.org>
|
16840
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1 | #!/usr/bin/env python |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
2 | # |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
3 | # Makes sure only one purple instance is running |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
4 | # |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
5 | # Purple is the legal property of its developers, whose names are too numerous |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
6 | # to list here. Please refer to the COPYRIGHT file distributed with this |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
7 | # source distribution. |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
8 | # |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
9 | # This program is free software; you can redistribute it and/or modify |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
10 | # it under the terms of the GNU General Public License as published by |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
11 | # the Free Software Foundation; either version 2 of the License, or |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
12 | # (at your option) any later version. |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
13 | # |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
14 | # This program is distributed in the hope that it will be useful, |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
17 | # GNU General Public License for more details. |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
18 | # |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
19 | # You should have received a copy of the GNU General Public License |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
20 | # along with this program; if not, write to the Free Software |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
18208
diff
changeset
|
21 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
|
16840
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
22 | # |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
23 | |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
24 | import sys |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
25 | import dbus |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
26 | import os |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
27 | |
|
18208
a27936adb5ca
1. Show the usage of -m in the help message.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16840
diff
changeset
|
28 | if len(sys.argv) == 1: |
|
a27936adb5ca
1. Show the usage of -m in the help message.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16840
diff
changeset
|
29 | print "Usage:", sys.argv[0], """<purple-client> [arguments] |
|
a27936adb5ca
1. Show the usage of -m in the help message.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16840
diff
changeset
|
30 | |
|
a27936adb5ca
1. Show the usage of -m in the help message.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16840
diff
changeset
|
31 | Example: |
|
a27936adb5ca
1. Show the usage of -m in the help message.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16840
diff
changeset
|
32 | """, sys.argv[0], "pidgin -d -c /my/home" |
|
a27936adb5ca
1. Show the usage of -m in the help message.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16840
diff
changeset
|
33 | sys.exit(1) |
|
a27936adb5ca
1. Show the usage of -m in the help message.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16840
diff
changeset
|
34 | |
|
16840
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
35 | home = os.path.expanduser('~/.purple/') |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
36 | for arg in range(1, len(sys.argv[1:])): |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
37 | if sys.argv[arg] == "-c": |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
38 | home = os.path.expanduser(sys.argv[arg + 1]) |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
39 | break |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
40 | |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
41 | bus = dbus.SessionBus() |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
42 | |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
43 | try: |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
44 | obj = bus.get_object("im.pidgin.purple.PurpleService", "/im/pidgin/purple/PurpleObject") |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
45 | purple = dbus.Interface(obj, "im.pidgin.purple.PurpleInterface") |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
46 | userdir = purple.PurpleUserDir() |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
47 | if not os.path.isabs(userdir): |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
48 | userdir = os.path.join(purple.PurpleHomeDir(), userdir) |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
49 | if home == userdir: |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
50 | print "Already running." |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
51 | purple.PurpleBlistShow() |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
52 | else: |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
53 | print "Starting client from a different home directory." |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
54 | raise |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
55 | except: |
|
1bb9975b28fa
Add a python script plugins/startup.py which will first check whether a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
56 | os.execlp(sys.argv[1], " ".join(sys.argv[2:])) |