[backend] implement remoteproject and project link handling in _history query