void GroupChatMsgArrivedNotify::process(InstancePtr instance, ConnectionPtr connection, const Uri& from, RequestMsg& msg) { group_messaging_server::methods::rpc::GrpChatMsgArrivedNotify notify; if (!notify.ParseFromString(msg.data())) { LOG(error, "parse error! " << DUMP_STRING(msg.data())); throw ParseException(); } data_.reset(new Data); data_->sender = UserPtID(notify.sender_ua_uri(), instance->getDomain()); data_->group_id = GroupID(from, instance->getDomain()); data_->msg_id = notify.msg_id(); data_->msg_time = notify.msg_time(); data_->content = notify.content(); data_->content_type = notify.content_type(); onNotification(instance); }
void ReminderNotify::process(InstancePtr instance, ConnectionPtr connection, const Uri& from, RequestMsg& msg) { instant_messaging_server::methods::rpc::UserNoticeArrivedNotify notify; if (!notify.ParseFromString(msg.data())) { LOG(error, "parse error! " << DUMP_STRING(msg.data())); throw ParseException(); } data_.reset(new Data); data_->sender = UserPtID(notify.sender_ua_uri(), instance->getDomain()); data_->time = notify.user_notice_time(); if (notify.user_notice_type() == "shaking-window remind") data_->reminder_type = REMINDER_SHAKING_WINDOW; else if (notify.user_notice_type() == "typing remind") data_->reminder_type = REMINDER_TYPING; else return; onNotification(instance); }