mirror of
https://github.com/twitter/the-algorithm.git
synced 2024-06-23 19:46:05 +02:00
![twitter-team](/assets/img/avatar_default.png)
Please note we have force-pushed a new initial commit in order to remove some publicly-available Twitter user information. Note that this process may be required in the future.
35 lines
1.2 KiB
Scala
35 lines
1.2 KiB
Scala
package com.twitter.home_mixer.marshaller.timelines
|
|
|
|
import com.twitter.home_mixer.model.request.DeviceContext
|
|
import com.twitter.product_mixer.core.model.marshalling.request.ClientContext
|
|
import com.twitter.timelineservice.{thriftscala => t}
|
|
import javax.inject.Inject
|
|
import javax.inject.Singleton
|
|
|
|
@Singleton
|
|
class DeviceContextMarshaller @Inject() () {
|
|
|
|
def apply(deviceContext: DeviceContext, clientContext: ClientContext): t.DeviceContext = {
|
|
t.DeviceContext(
|
|
countryCode = clientContext.countryCode,
|
|
languageCode = clientContext.languageCode,
|
|
clientAppId = clientContext.appId,
|
|
ipAddress = clientContext.ipAddress,
|
|
guestId = clientContext.guestId,
|
|
userAgent = clientContext.userAgent,
|
|
deviceId = clientContext.deviceId,
|
|
isPolling = deviceContext.isPolling,
|
|
requestContext = deviceContext.requestContext,
|
|
referrer = None,
|
|
tfeAuthHeader = None,
|
|
mobileDeviceId = clientContext.mobileDeviceId,
|
|
isSessionStart = None,
|
|
latestControlAvailable = deviceContext.latestControlAvailable,
|
|
guestIdMarketing = clientContext.guestIdMarketing,
|
|
isInternalOrTwoffice = clientContext.isTwoffice,
|
|
guestIdAds = clientContext.guestIdAds,
|
|
isUrtRequest = Some(true)
|
|
)
|
|
}
|
|
}
|