def _addCompanyChannelToStorage(self): companyChannelConfig = g_settings.server.XMPP.getChannelByType(XMPP_MUC_CHANNEL_TYPE.COMPANY) if companyChannelConfig is not None and companyChannelConfig['enabled']: channelJid = makeSystemRoomJID(channelType=XMPP_MUC_CHANNEL_TYPE.COMPANY) channelName = companyChannelConfig['userString'] or channelJid.getDomain() companyChannelEntity = entities.XMPPMucChannelEntity(channelJid, channelName, isSystem=True, isLazy=True, channelType=XMPP_MUC_CHANNEL_TYPE.COMPANY) if self.channelsStorage.addChannel(companyChannelEntity): g_messengerEvents.channels.onChannelInited(companyChannelEntity) return
def __init__(self, mucChannelType=XMPP_MUC_CHANNEL_TYPE.UNKNOWN, name=''): jid = makeSystemRoomJID(channelType=mucChannelType) channelName = name or jid.getDomain() super(XmppSystemChannelEntity, self).__init__(jid, name=channelName, isLazy=True, isSystem=True, channelType=mucChannelType)
def _addCommonChannelToStorage(self): sysChannelConfig = g_settings.server.XMPP.getChannelByType( XMPP_MUC_CHANNEL_TYPE.STANDARD) if sysChannelConfig is not None and sysChannelConfig['enabled']: channelJid = makeSystemRoomJID( channelType=XMPP_MUC_CHANNEL_TYPE.STANDARD) channelName = sysChannelConfig[ 'userString'] or channelJid.getDomain() sysChannelEntity = entities.XMPPMucChannelEntity( channelJid, channelName, isSystem=True, isLazy=True, channelType=XMPP_MUC_CHANNEL_TYPE.STANDARD) if self.channelsStorage.addChannel(sysChannelEntity): g_messengerEvents.channels.onChannelInited(sysChannelEntity) return