Image copyright Twitter/@realDonaldTrump

After US President Donald Trump's Twitter account was briefly deactivated last week by a Twitter employee, many people started wondering if there would be a similar period of silence this week.

After all, Mr Trump is currently in China, known for its "great firewall" that blocks access to many foreign websites, including Twitter.

As it happens, the president has kept up his tweeting in China, thanking his hosts for their hospitality, firing a warning at North Korea, and even changing his Twitter header image to one of him, Chinese president Xi Jinping, and the two first ladies, surrounded by dozens of Chinese performers.

So what's going on? There's two sides to this - a technical aspect, and a political one.

Twitter is blocked on China - but not for the privileged or tech-savvy

Thousands of websites and social media platforms are blocked in mainland China. Twitter, Facebook, Instagram and Whatsapp are all blocked or disrupted, as are websites the authorities consider sensitive. (The BBC News website has been blocked in the past, as have the New York Times and the Economist).

Many people circumvent China's firewall by using virtual private networks (VPNs), although the government is now cracking down on VPN vendors.

But the Chinese authorities aren't beyond making exceptions to the rules.

Officials briefly contemplated relaxing its censorship laws in a Shanghai Free Trade Zone back in 2013. And the official news agency, Xinhua, uses Twitter to promote its articles - to the consternation of many Chinese social media users who have accused the government of double standards.

Ahead of Mr Trump's arrival, China's Vice Foreign Minister Zheng Zeguang assured reporters he would be able to tweet as much as he wants, saying: "We take everything into account on receiving foreign heads of state, so you should have no reservations about Mr President's ability to keep in touch with the outside."

It's an approach that's been criticised by rights groups.

Sophie Richardson, China director at Human Rights Watch, told Bloomberg: "If President Trump is able to tweet from China it's because he enjoys privileges President Xi systematically denies to people across that country."

So how is Mr Trump accessing Twitter?

Journalists travelling with Mr Trump have found they can access Twitter on their mobile phones, as long as they are using 3G or 4G roaming networks on a foreign sim card.

In practice, foreign officials visiting China are told to follow strict security guidelines, and have sometimes been advised against using their own phones or laptops in the country.

So Mr Trump probably isn't just tweeting off his usual mobile phone.

Image copyright Reuters Image caption Mr Trump is a prolific tweeter - while Mr Xi is not

For obvious reasons, the US hasn't given the full details of their arrangements to ensure Mr Trump can go online securely.

But, while en route to Beijing, a White House official did assure reporters that Mr Trump would keep up his tweeting from China, saying "I'm sure we've got the gear aboard this airplane to make it happen."

Mr Trump's first three tweets from China were sent from a web browser, rather than a phone. However, his fourth tweet, where he celebrates the one-year anniversary of his election win, was sent from an iPhone, data from Tweetdeck shows.

Twitter is a political tool

Don't forget that tweeting is also a political act for Mr Trump - he's used it to announce policies, lambast political rivals, and criticise other countries - including China.

If Mr Trump had decided to stay off Twitter in China, it could have been perceived as him being silenced, albeit virtually, by Chinese censorship.

That could explain why the White House official emphasised to reporters that "the president will tweet whatever he wants [while in China]. That's his way of communicating directly with the American people."

However, observers have also picked up on the contrast in tone between Mr Trump's tweets in Beijing, and some of his previous posts.

Although Mr Trump's Wednesday tweets focused on thanking his hosts for the "beautiful welcome", adding "Melania and I will never forget it!", he has previously used Twitter to criticise China's currency devaluation, and argue that China has not done enough to deter North Korea from its nuclear ambitions.

Meanwhile, Chinese state media outlets have enthusiastically picked up on Mr Trump's latest China tweets, and the fact he has changed his header image to one of him with Mr Xi.

"Mr Trump was full of feeling after visiting the Forbidden Palace - and even changed his Twitter header photo!" TV station iFeng reported on Chinese microblog weibo, with a thumbs up emoji.

Of course, there was no mention of the fact that Twitter is not officially accessible in China.