Abstract In this paper we develop a dynamical information diffusion model which features the affinity of people with information disseminated in social networks. Four types of agents, i.e., susceptible, informed, known, and refractory ones, are involved in the system, and the affinity mechanism composing of an affinity threshold which represents the fitness of information to be propagated is incorporated. The model can be generally described by a time-inhomogeneous Markov chain, which is governed by its master (Kolmogorov) equation. Based on the Wei-Norman method, we derive analytical solutions of the model by constructing a low-dimensional Lie algebra. Numerical examples are provided to illustrate the obtained theoretical results. This study provides useful insights into the closed-form solutions of complex social dynamics models through the Lie algebra method.