gajim accepts file transfer

master
Stefan Krulj 14 years ago
parent 2425395575
commit 1babaeab01
  1. 5
      brathuhn.py
  2. 4
      config.py
  3. 11
      main.py

@ -153,12 +153,14 @@ def __presenceCB(conn,msg):
if msg.getType()=='unavailable':
nick=msg.getNick()
if nick==None:
if msg.getFrom() in users:
del users[msg.getFrom()]
#Disconnect
if not msg.getFrom() in users:
for listener in status_listeners:
listener(msg.getFrom(),msg,STATUS_OFFLINE)
else:
if msg.getFrom() in users:
del users[msg.getFrom()]
#Rename
if not msg.getFrom() in users:
@ -202,7 +204,7 @@ def __ignore_first(conn,msg):
__messageCB(conn,msg)
jid=xmpp.protocol.JID(node=NAME,domain=SRV,resource='bot')
jid=xmpp.protocol.JID(node=NAME,domain=SRV,resource=RESOURCE)
cl=xmpp.Client(jid.getDomain(),debug=[])
def connect_and_join():
@ -239,6 +241,7 @@ def connect_and_join():
#add the help command
addCommand("help","Prints this help message",__help)
addPrivateCommand("help","Prints this help message (in private chat)",__help)
#join the room
cl.send(msg)

@ -7,6 +7,10 @@ cp.read(["/etc/brathuhn/config.cfg","brathuhn.cfg",os.path.expanduser('~/.brathu
NAME = cp.get("Account","NAME")
SRV = cp.get("Account","SRV")
PWD = cp.get("Account","PWD")
try:
RESOURCE = cp.get("Account","RESOURCE")
except:
RESOURCE = 'bot'
ROOM = cp.get("Conference","ROOM")
PWD_ROOM = cp.get("Conference","PWD_ROOM")

@ -3,6 +3,8 @@
import brathuhn
import stream_ft,xmpp
import kraken
import get_quote
import logger
@ -12,6 +14,15 @@ import tantrum
import tell
import last_active
def foo(msg,args):
cim = stream_ft.create_init_message(brathuhn.room_nick,msg.getFrom(),"brathuhn.py")
brathuhn.cl.send(cim)
brathuhn.addPrivateCommand("foo","asdasdasd",foo)
brathuhn.connect_and_join()
brathuhn.cl.RegisterHandler('iq',stream_ft.ft_listener)
brathuhn.loop()

Loading…
Cancel
Save