reintroduce db for outgoing encrypted msgs only; changed to include local socket server