Explorar el Código

Add message archive management to prosody

Bob Mottram hace 8 años
padre
commit
d51af9b3c4
Se han modificado 1 ficheros con 29 adiciones y 1 borrados
  1. 29
    1
      src/freedombone

+ 29
- 1
src/freedombone Ver fichero

@@ -6934,10 +6934,37 @@ function install_tox_client {
6934 6934
 	echo 'install_tox_client' >> $COMPLETION_FILE
6935 6935
 }
6936 6936
 
6937
+function update_prosody_modules {
6938
+	if [ ! -d $INSTALL_DIR/prosody-modules ]; then
6939
+		return
6940
+	fi
6941
+	if [ ! -d /usr/lib/prosody ]; then
6942
+		return
6943
+	fi
6944
+
6945
+	cd $INSTALL_DIR/prosody-modules
6946
+	hg pull
6947
+	hg update
6948
+
6949
+	# support onion addresses
6950
+	if [ -f $INSTALL_DIR/prosody-modules/mod_onions/mod_onions.lua ]; then
6951
+		cp $INSTALL_DIR/prosody-modules/mod_onions/mod_onions.lua /usr/lib/prosody/modules/mod_onions.lua
6952
+	fi
6953
+
6954
+	# message archive management
6955
+	# https://modules.prosody.im/mod_mam.html
6956
+	if [ -d cp $INSTALL_DIR/prosody-modules/mod_mam ]; then
6957
+		cp $INSTALL_DIR/prosody-modules/mod_mam/*.lua /usr/lib/prosody/modules
6958
+	fi
6959
+}
6960
+
6937 6961
 function install_xmpp {
6938 6962
 	if [[ $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_MAILBOX" || $SYSTEM_TYPE == "$VARIANT_CLOUD" || $SYSTEM_TYPE == "$VARIANT_SOCIAL" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_DEVELOPER" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
6939 6963
 		return
6940 6964
 	fi
6965
+
6966
+	update_prosody_modules
6967
+
6941 6968
 	if grep -Fxq "install_xmpp" $COMPLETION_FILE; then
6942 6969
 		return
6943 6970
 	fi
@@ -6958,7 +6985,7 @@ function install_xmpp {
6958 6985
 	fi
6959 6986
 
6960 6987
 	# install the onions module
6961
-	cp $INSTALL_DIR/prosody-modules/mod_onions/mod_onions.lua /usr/lib/prosody/modules/mod_onions.lua
6988
+	update_prosody_modules
6962 6989
 	if [ ! -f /usr/lib/prosody/modules/mod_onions.lua ]; then
6963 6990
 		echo $'mod_onions.lua could not be copied to the prosody modules directory'
6964 6991
 		exit 63952
@@ -7001,6 +7028,7 @@ function install_xmpp {
7001 7028
 		echo '  "tls"; -- Enable mod_tls' >> /etc/prosody/conf.avail/xmpp.cfg.lua
7002 7029
 		echo '  "saslauth"; -- Enable mod_saslauth' >> /etc/prosody/conf.avail/xmpp.cfg.lua
7003 7030
 		echo '  "onions"; -- Enable chat via onion service' >> /etc/prosody/conf.avail/xmpp.cfg.lua
7031
+		echo '  "mam"; -- Message archive management' >> /etc/prosody/conf.avail/xmpp.cfg.lua
7004 7032
 		echo '}' >> /etc/prosody/conf.avail/xmpp.cfg.lua
7005 7033
 		echo '' >> /etc/prosody/conf.avail/xmpp.cfg.lua
7006 7034
 		echo 'c2s_require_encryption = true' >> /etc/prosody/conf.avail/xmpp.cfg.lua