we can now set and receive subjects
This commit is contained in:
parent
6c95160913
commit
7c9ec2229b
3 changed files with 36 additions and 5 deletions
11
Core/core.py
11
Core/core.py
|
@ -367,6 +367,11 @@ class GajimCore:
|
||||||
self.hub.sendPlugin('MSGERROR', self.connexions[con], \
|
self.hub.sendPlugin('MSGERROR', self.connexions[con], \
|
||||||
(str(msg.getFrom()), msg.getErrorCode(), msg.getError(), msgtxt, tim))
|
(str(msg.getFrom()), msg.getErrorCode(), msg.getError(), msgtxt, tim))
|
||||||
elif typ == 'groupchat':
|
elif typ == 'groupchat':
|
||||||
|
subject = msg.getSubject()
|
||||||
|
if subject:
|
||||||
|
self.hub.sendPlugin('GC_SUBJECT', self.connexions[con], \
|
||||||
|
(str(msg.getFrom()), subject))
|
||||||
|
else:
|
||||||
self.hub.sendPlugin('GC_MSG', self.connexions[con], \
|
self.hub.sendPlugin('GC_MSG', self.connexions[con], \
|
||||||
(str(msg.getFrom()), msgtxt, tim))
|
(str(msg.getFrom()), msgtxt, tim))
|
||||||
else:
|
else:
|
||||||
|
@ -906,6 +911,12 @@ class GajimCore:
|
||||||
msg.setType('groupchat')
|
msg.setType('groupchat')
|
||||||
con.send(msg)
|
con.send(msg)
|
||||||
self.hub.sendPlugin('MSGSENT', ev[1], ev[2])
|
self.hub.sendPlugin('MSGSENT', ev[1], ev[2])
|
||||||
|
#('GC_SUBJECT', account, (jid, subject))
|
||||||
|
elif ev[0] == 'GC_SUBJECT':
|
||||||
|
msg = common.jabber.Message(ev[2][0])
|
||||||
|
msg.setType('groupchat')
|
||||||
|
msg.setSubject(ev[2][1])
|
||||||
|
con.send(msg)
|
||||||
#('GC_STATUS', account, (nick, jid, show, status))
|
#('GC_STATUS', account, (nick, jid, show, status))
|
||||||
elif ev[0] == 'GC_STATUS':
|
elif ev[0] == 'GC_STATUS':
|
||||||
if ev[2][2] == 'offline':
|
if ev[2][2] == 'offline':
|
||||||
|
|
|
@ -6881,7 +6881,7 @@ Custom</property>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkEntry" id="entry_subject">
|
<widget class="GtkEntry" id="subject_entry">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="editable">True</property>
|
<property name="editable">True</property>
|
||||||
|
@ -6891,6 +6891,7 @@ Custom</property>
|
||||||
<property name="has_frame">True</property>
|
<property name="has_frame">True</property>
|
||||||
<property name="invisible_char">*</property>
|
<property name="invisible_char">*</property>
|
||||||
<property name="activates_default">False</property>
|
<property name="activates_default">False</property>
|
||||||
|
<signal name="key_press_event" handler="on_subject_entry_key_press_event" last_modification_time="Fri, 04 Mar 2005 20:46:50 GMT"/>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="padding">0</property>
|
<property name="padding">0</property>
|
||||||
|
|
|
@ -654,6 +654,14 @@ class gc:
|
||||||
img = self.plugin.roster.pixbufs[show]
|
img = self.plugin.roster.pixbufs[show]
|
||||||
model.set_value(iter, 0, img)
|
model.set_value(iter, 0, img)
|
||||||
|
|
||||||
|
def set_subject(self, subject):
|
||||||
|
self.xml.get_widget('subject_entry').set_text(subject)
|
||||||
|
|
||||||
|
def on_subject_entry_key_press_event(self, widget, event):
|
||||||
|
if event.keyval == gtk.keysyms.Return:
|
||||||
|
subject = self.xml.get_widget('subject_entry').get_text()
|
||||||
|
self.plugin.send('GC_SUBJECT', self.account, (self.jid, subject))
|
||||||
|
|
||||||
def on_msg_key_press_event(self, widget, event):
|
def on_msg_key_press_event(self, widget, event):
|
||||||
"""When a key is pressed :
|
"""When a key is pressed :
|
||||||
if enter is pressed without the shit key, message (if not empty) is sent
|
if enter is pressed without the shit key, message (if not empty) is sent
|
||||||
|
@ -915,6 +923,7 @@ class gc:
|
||||||
self.xml.signal_connect('on_row_activated', self.on_row_activated)
|
self.xml.signal_connect('on_row_activated', self.on_row_activated)
|
||||||
self.xml.signal_connect('on_row_expanded', self.on_row_expanded)
|
self.xml.signal_connect('on_row_expanded', self.on_row_expanded)
|
||||||
self.xml.signal_connect('on_row_collapsed', self.on_row_collapsed)
|
self.xml.signal_connect('on_row_collapsed', self.on_row_collapsed)
|
||||||
|
self.xml.signal_connect('on_subject_entry_key_press_event', self.on_subject_entry_key_press_event)
|
||||||
|
|
||||||
class history_window:
|
class history_window:
|
||||||
"""Class for bowser agent window :
|
"""Class for bowser agent window :
|
||||||
|
@ -2742,6 +2751,14 @@ class plugin:
|
||||||
get_property('is-active'):
|
get_property('is-active'):
|
||||||
self.systray.add_jid(jid, account)
|
self.systray.add_jid(jid, account)
|
||||||
|
|
||||||
|
def handle_event_gc_subject(self, account, array):
|
||||||
|
#('GC_SUBJECT', account, (jid, subject))
|
||||||
|
jids = string.split(array[0], '/')
|
||||||
|
jid = jids[0]
|
||||||
|
if not self.windows[account]['gc'].has_key(jid):
|
||||||
|
return
|
||||||
|
self.windows[account]['gc'][jid].set_subject(array[1])
|
||||||
|
|
||||||
def handle_event_bad_passphrase(self, account, array):
|
def handle_event_bad_passphrase(self, account, array):
|
||||||
warning_dialog(_("Your GPG passphrase is wrong, so you are connected without your GPG key."))
|
warning_dialog(_("Your GPG passphrase is wrong, so you are connected without your GPG key."))
|
||||||
|
|
||||||
|
@ -2814,6 +2831,8 @@ class plugin:
|
||||||
self.handle_event_log_line(ev[1], ev[2])
|
self.handle_event_log_line(ev[1], ev[2])
|
||||||
elif ev[0] == 'GC_MSG':
|
elif ev[0] == 'GC_MSG':
|
||||||
self.handle_event_gc_msg(ev[1], ev[2])
|
self.handle_event_gc_msg(ev[1], ev[2])
|
||||||
|
elif ev[0] == 'GC_SUBJECT':
|
||||||
|
self.handle_event_gc_subject(ev[1], ev[2])
|
||||||
elif ev[0] == 'BAD_PASSPHRASE':
|
elif ev[0] == 'BAD_PASSPHRASE':
|
||||||
self.handle_event_bad_passphrase(ev[1], ev[2])
|
self.handle_event_bad_passphrase(ev[1], ev[2])
|
||||||
elif ev[0] == 'GPG_SECRETE_KEYS':
|
elif ev[0] == 'GPG_SECRETE_KEYS':
|
||||||
|
@ -2874,8 +2893,8 @@ class plugin:
|
||||||
'NOTIFY', 'MSG', 'MSGERROR', 'SUBSCRIBED', 'UNSUBSCRIBED', \
|
'NOTIFY', 'MSG', 'MSGERROR', 'SUBSCRIBED', 'UNSUBSCRIBED', \
|
||||||
'SUBSCRIBE', 'AGENTS', 'AGENT_INFO', 'REG_AGENT_INFO', 'QUIT', \
|
'SUBSCRIBE', 'AGENTS', 'AGENT_INFO', 'REG_AGENT_INFO', 'QUIT', \
|
||||||
'ACC_OK', 'CONFIG', 'MYVCARD', 'VCARD', 'LOG_NB_LINE', 'LOG_LINE', \
|
'ACC_OK', 'CONFIG', 'MYVCARD', 'VCARD', 'LOG_NB_LINE', 'LOG_LINE', \
|
||||||
'VISUAL', 'GC_MSG', 'BAD_PASSPHRASE', 'GPG_SECRETE_KEYS', \
|
'VISUAL', 'GC_MSG', 'GC_SUBJECT', 'BAD_PASSPHRASE', \
|
||||||
'ROSTER_INFO', 'MSGSENT'])
|
'GPG_SECRETE_KEYS', 'ROSTER_INFO', 'MSGSENT'])
|
||||||
self.send('ASK_CONFIG', None, ('GtkGui', 'GtkGui', {'autopopup':1,\
|
self.send('ASK_CONFIG', None, ('GtkGui', 'GtkGui', {'autopopup':1,\
|
||||||
'autopopupaway':1,\
|
'autopopupaway':1,\
|
||||||
'showoffline':0,\
|
'showoffline':0,\
|
||||||
|
|
Loading…
Add table
Reference in a new issue