Module: Imwukong::Api::Conversation

Defined in:
lib/imwukong/api-obsolete/conversation.rb

Constant Summary collapse

CONVERSATION =

refer to: imwukong.com/#doc/doc/server/index.htm??聊天会话

'conversation'.freeze

Instance Method Summary collapse

Instance Method Details

#add_member(open_id, cid, members, message) ⇒ Object



71
72
73
74
75
76
77
78
79
# File 'lib/imwukong/api-obsolete/conversation.rb', line 71

def add_member(open_id, cid, members, message)
  params = {
    openId:         open_id,
    conversationId: cid,
    members:        members,
    message:        message
  }
  wk_post(CONVERSATION, 'member/add', params)
end

#create(params) ⇒ Object



8
9
10
# File 'lib/imwukong/api-obsolete/conversation.rb', line 8

def create(params)
  wk_post(CONVERSATION, 'create', params)
end

#info(open_id, conversation_id) ⇒ Object

查询会话信息(包括会话最近的消息和消息状态)



22
23
24
25
26
27
28
# File 'lib/imwukong/api-obsolete/conversation.rb', line 22

def info(open_id, conversation_id)
  params = {
    openId:         open_id,
    conversationId: conversation_id
  }
  wk_post(CONVERSATION, 'get', params)
end

#infos(open_id, conversation_ids) ⇒ Object

批量查询会话信息(包括会话最近的消息和消息状态)



31
32
33
34
35
36
37
38
# File 'lib/imwukong/api-obsolete/conversation.rb', line 31

def infos(open_id, conversation_ids)
  params = {
    openId:          open_id,
    conversationIds: conversation_ids
  }
  # what a weired thing ~
  wk_post(CONVERSATION+'s', 'get', params)
end

#page_group_infos(open_id, cursor, count) ⇒ Object

分页查询群聊会话列表

Parameters:

  • open_id,

    integer, 用户id

  • cursor,

    integer, 会话时间戳起始时间,第一次取值为0,之后取最后一个会话的createAt值



53
54
55
56
57
58
59
60
# File 'lib/imwukong/api-obsolete/conversation.rb', line 53

def page_group_infos(open_id, cursor, count)
  params = {
    openId: open_id,
    cursor: cursor,
    count:  count
  }
  wk_get(CONVERSATION, 'groups/get', params)
end

#page_infos(open_id, cursor, count) ⇒ Object



62
63
64
65
66
67
68
69
# File 'lib/imwukong/api-obsolete/conversation.rb', line 62

def page_infos(open_id, cursor, count)
  params = {
    openId: open_id,
    cursor: cursor,
    count:  count
  }
  wk_get(CONVERSATION+'s', 'list', params)
end

#profiles(open_id, conversation_ids) ⇒ Object

查询会话概要信息



13
14
15
16
17
18
19
# File 'lib/imwukong/api-obsolete/conversation.rb', line 13

def profiles(open_id, conversation_ids)
  params = {
    openId:          open_id,
    conversationIds: conversation_ids
  }
  wk_post(CONVERSATION, 'profiles/get', params)
end

#remove_member(open_id, cid, members, message) ⇒ Object



81
82
83
84
85
86
87
88
89
# File 'lib/imwukong/api-obsolete/conversation.rb', line 81

def remove_member(open_id, cid, members, message)
  params = {
    openId:         open_id,
    conversationId: cid,
    members:        members,
    message:        message
  }
  wk_post(CONVERSATION, 'member/remove', params)
end

#unlimit_infos(open_id, conversation_id) ⇒ Object

无条件查询会话信息,首屏删除也可以取得(包括会话最近的消息和消息状态)



41
42
43
44
45
46
47
# File 'lib/imwukong/api-obsolete/conversation.rb', line 41

def unlimit_infos(open_id, conversation_id)
  params = {
    openId:         open_id,
    conversationId: conversation_id
  }
  wk_post(CONVERSATION, 'unlimited/get', params)
end

#update_tag(open_id, cid, tag) ⇒ Object



91
92
93
94
95
96
97
98
# File 'lib/imwukong/api-obsolete/conversation.rb', line 91

def update_tag(open_id, cid, tag)
  params = {
    openId:         open_id,
    conversationId: cid,
    tag:            tag
  }
  wk_post(CONVERSATION, 'tag/update', params)
end