StatusOptions::StatusOptions(ShowType aShowType, StatusFlags aStatusFlags) { std::memset((void*)&d, 0, sizeof(git_status_options)); d.version = GIT_STATUS_OPTIONS_VERSION; setShowType(aShowType); setStatusFlags(aStatusFlags); }
void GaduProtocol::sendStatusToServer() { if (!isConnected() && !isDisconnecting()) return; if (!GaduSession) return; // some services have per-status configuration configureServices(); Status newStatus = status(); int friends = account().privateStatus() ? GG_STATUS_FRIENDS_MASK : 0; int type = GaduProtocolHelper::gaduStatusFromStatus(newStatus); bool hasDescription = !newStatus.description().isEmpty(); setStatusFlags(); m_lastSentStatus = newStatus; auto writableSessionToken = Connection->writableSessionToken(); if (hasDescription) gg_change_status_descr( writableSessionToken.rawSession(), type | friends, newStatus.description().toUtf8().constData()); else gg_change_status(writableSessionToken.rawSession(), type | friends); account().accountContact().setCurrentStatus(status()); }
void GaduProtocol::setupLoginParams() { memset(&GaduLoginParams, 0, sizeof(GaduLoginParams)); auto accountData = GaduAccountData{account()}; GaduLoginParams.uin = account().id().toULong(); GaduLoginParams.password = qstrdup(account().password().toUtf8().constData()); GaduLoginParams.async = 1; auto gaduStatus = GaduProtocolHelper::gaduStatusFromStatus(loginStatus()); GaduLoginParams.status = gaduStatus | (account().privateStatus() ? GG_STATUS_FRIENDS_MASK : 0); if (!loginStatus().description().isEmpty()) GaduLoginParams.status_descr = qstrdup(loginStatus().description().toUtf8().constData()); GaduLoginParams.tls = GG_SSL_REQUIRED; ActiveServer = m_gaduServersManager->getServer(); bool haveServer = !ActiveServer.first.isNull(); GaduLoginParams.server_addr = haveServer ? htonl(ActiveServer.first.toIPv4Address()) : 0; GaduLoginParams.server_port = haveServer ? ActiveServer.second : 0; GaduLoginParams.protocol_version = GG_PROTOCOL_VERSION_110; GaduLoginParams.compatibility = GG_COMPAT_LEGACY; // TODO: #2961 GaduLoginParams.client_version = qstrdup(m_versionService->nameWithVersion().toUtf8().constData()); GaduLoginParams.protocol_features = GG_FEATURE_DND_FFC | GG_FEATURE_TYPING_NOTIFICATION | GG_FEATURE_MULTILOGON | GG_FEATURE_USER_DATA; GaduLoginParams.encoding = GG_ENCODING_UTF8; GaduLoginParams.has_audio = false; GaduLoginParams.last_sysmsg = m_configuration->deprecatedApi()->readNumEntry("General", "SystemMsgIndex", 1389); GaduLoginParams.image_size = qMax(qMin(m_configuration->deprecatedApi()->readNumEntry("Chat", "MaximumImageSizeInKiloBytes", 255), 255), 0); GaduLoginParams.struct_size = sizeof(struct gg_login_params); setStatusFlags(); }