Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Daniel Brötzmann
gajim
Commits
11f74c9e
Commit
11f74c9e
authored
21 years ago
by
Yann Leboulanger
Browse files
Options
Downloads
Patches
Plain Diff
improvements, status messages in chat window
parent
fd9c01fc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
core/core.py
+6
-4
6 additions, 4 deletions
core/core.py
doc/gajimrc
+5
-3
5 additions, 3 deletions
doc/gajimrc
plugins/gtkgui/gtkgui.py
+23
-4
23 additions, 4 deletions
plugins/gtkgui/gtkgui.py
with
34 additions
and
11 deletions
core/core.py
+
6
−
4
View file @
11f74c9e
...
...
@@ -78,11 +78,11 @@ def presenceCB(self, con, prs):
log
.
debug
(
"
unsubscribe request from %s
"
%
who
)
elif
type
==
'
unsubscribed
'
:
log
.
debug
(
"
we are now unsubscribed to %s
"
%
who
)
# END presenceCB
def
disconnectedCB
(
self
,
con
):
log
.
debug
(
"
disconnectedCB
"
)
self
.
con
.
disconnect
()
# END disconenctedCB
def
connect
(
self
,
account
):
...
...
@@ -95,14 +95,15 @@ def connect(self, account):
try
:
self
.
con
.
connect
()
except
IOError
,
e
:
log
.
debug
(
"
Couldn
'
t connect to %s
"
%
e
)
sys
.
exit
(
0
)
log
.
debug
(
"
Couldn
'
t connect to
%s
%s
"
%
(
hostname
,
e
)
)
return
0
else
:
log
.
debug
(
"
Connected to server
"
)
self
.
con
.
setMessageHandler
(
self
.
messageCB
)
self
.
con
.
setPresenceHandler
(
self
.
presenceCB
)
self
.
con
.
setDisconnectHandler
(
self
.
disconnectedCB
)
#BUG in jabberpy library : if hostname is wrong : "boucle"
if
self
.
con
.
auth
(
name
,
password
,
ressource
):
self
.
con
.
requestRoster
()
roster
=
self
.
con
.
getRoster
().
getRaw
()
...
...
@@ -112,7 +113,8 @@ def connect(self, account):
self
.
con
.
sendInitPresence
()
self
.
connected
=
1
else
:
sys
.
exit
(
1
)
log
.
debug
(
"
Couldn
'
t authentificate to %s
"
%
hostname
)
return
0
# END connect
def
mainLoop
(
self
):
...
...
This diff is collapsed.
Click to expand it.
doc/gajimrc
+
5
−
3
View file @
11f74c9e
[
Server
]
[
Profile
]
hostname = SERVER HOSTNAME
accounts = Account1
[
Profile
]
[
Account1
]
hostname = SERVER HOSTNAME
name = LOGIN NAME
password = PASSWORD
ressource = gajim
...
...
@@ -20,6 +21,7 @@ modules = sock
showoffline = 0
inmsgcolor = red
outmsgcolor = blue
statusmsgcolor = green
iconstyle = sun
autopopup = 0
...
...
This diff is collapsed.
Click to expand it.
plugins/gtkgui/gtkgui.py
+
23
−
4
View file @
11f74c9e
...
...
@@ -233,10 +233,15 @@ def delete_event(self, widget):
def
print_conversation
(
self
,
txt
,
contact
=
None
):
end_iter
=
self
.
convTxtBuffer
.
get_end_iter
()
if
contact
:
self
.
convTxtBuffer
.
insert_with_tags_by_name
(
end_iter
,
'
<moi>
'
,
'
outgoing
'
)
if
contact
==
'
status
'
:
self
.
convTxtBuffer
.
insert_with_tags_by_name
(
end_iter
,
txt
+
'
\n
'
,
\
'
status
'
)
else
:
self
.
convTxtBuffer
.
insert_with_tags_by_name
(
end_iter
,
'
<moi>
'
,
'
outgoing
'
)
self
.
convTxtBuffer
.
insert
(
end_iter
,
txt
+
'
\n
'
)
else
:
self
.
convTxtBuffer
.
insert_with_tags_by_name
(
end_iter
,
'
<
'
+
self
.
user
.
name
+
'
>
'
,
'
incoming
'
)
self
.
convTxtBuffer
.
insert
(
end_iter
,
txt
+
'
\n
'
)
self
.
convTxtBuffer
.
insert
(
end_iter
,
txt
+
'
\n
'
)
self
.
conversation
.
scroll_to_mark
(
\
self
.
convTxtBuffer
.
get_mark
(
'
end
'
),
0.1
,
0
,
0
,
0
)
...
...
@@ -287,12 +292,17 @@ def __init__(self, user, roster):
self
.
tag
=
self
.
convTxtBuffer
.
create_tag
(
"
incoming
"
)
color
=
self
.
cfgParser
.
GtkGui_inmsgcolor
if
not
color
:
color
=
red
color
=
'
red
'
self
.
tag
.
set_property
(
"
foreground
"
,
color
)
self
.
tag
=
self
.
convTxtBuffer
.
create_tag
(
"
outgoing
"
)
color
=
self
.
cfgParser
.
GtkGui_outmsgcolor
if
not
color
:
color
=
blue
color
=
'
blue
'
self
.
tag
.
set_property
(
"
foreground
"
,
color
)
self
.
tag
=
self
.
convTxtBuffer
.
create_tag
(
"
status
"
)
color
=
self
.
cfgParser
.
GtkGui_statusmsgcolor
if
not
color
:
color
=
'
green
'
self
.
tag
.
set_property
(
"
foreground
"
,
color
)
class
roster
:
...
...
@@ -570,6 +580,15 @@ def read_queue(self):
self
.
r
.
mkroster
(
ev
[
1
])
elif
ev
[
0
]
==
'
NOTIFY
'
:
jid
=
string
.
split
(
ev
[
1
][
0
],
'
/
'
)[
0
]
#Update user
if
self
.
r
.
l_contact
.
has_key
(
jid
):
u
=
self
.
r
.
l_contact
[
jid
][
'
user
'
]
u
.
show
=
ev
[
1
][
1
]
u
.
status
=
ev
[
1
][
2
]
#Print status in chat window
if
self
.
r
.
tab_messages
.
has_key
(
jid
):
self
.
r
.
tab_messages
[
jid
].
print_conversation
(
\
"
%s is now %s (%s)
"
%
(
u
.
name
,
ev
[
1
][
1
],
ev
[
1
][
2
]),
'
status
'
)
if
string
.
find
(
jid
,
"
@
"
)
<=
0
:
#It must be an agent
jid
=
string
.
replace
(
jid
,
'
@
'
,
''
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment