コード例 #1
0
ファイル: jabber.py プロジェクト: DroneD/droned
def joinEnvironmentalChatRoom(event):
    """determine if we should join a chatroom"""
    chat = ChatRoom(config.ROMEO_ENV_NAME)
    #make sure the drone can be managed by the room
    username = config.ROMEO_ENV_NAME
    jbserver = jconfig.JABBER_CHAT_SERVICE
    jid = "%(username)s@%(jbserver)s" % locals()
    Team('support').addMember(jid)
    #get the conversation context set to some sane defaults
    conversation = Conversation(jid)
    #grant the room access to the server
    if jconfig.JABBER_TRUST_ROOM:
        conversation.grantAuthorization(notify=False)
    #be vain assume all conversations revolve around ourself
    context = {
        'server': Server(config.HOSTNAME),
        'subject': Server(config.HOSTNAME),
    }
    conversation.context.update(context)
    #finally join the room
    chat.join()
コード例 #2
0
ファイル: jabber.py プロジェクト: c0ns0le/droned
def joinEnvironmentalChatRoom(event):
    """determine if we should join a chatroom"""
    chat = ChatRoom(config.ROMEO_ENV_NAME)
    #make sure the drone can be managed by the room
    username = config.ROMEO_ENV_NAME
    jbserver = jconfig.JABBER_CHAT_SERVICE
    jid = "%(username)s@%(jbserver)s" % locals()
    Team('support').addMember(jid)
    #get the conversation context set to some sane defaults
    conversation = Conversation(jid)
    #grant the room access to the server
    if jconfig.JABBER_TRUST_ROOM:
        conversation.grantAuthorization(notify=False)
    #be vain assume all conversations revolve around ourself
    context = {
        'server': Server(config.HOSTNAME),
        'subject': Server(config.HOSTNAME),
    }
    conversation.context.update(context)
    #finally join the room
    chat.join()
コード例 #3
0
ファイル: chat.py プロジェクト: DroneD/droned
def joinchat(conversation, room):
  conversation.say("Ok, I will join the %s chat room." % room)
  chat = ChatRoom(room)
  chat.join()
コード例 #4
0
ファイル: chat.py プロジェクト: c0ns0le/droned
def joinchat(conversation, room):
    conversation.say("Ok, I will join the %s chat room." % room)
    chat = ChatRoom(room)
    chat.join()