在Lync 2013中显示用户图片 [英] Display User Picture in Lync 2013

查看:128
本文介绍了在Lync 2013中显示用户图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用lync 2013 sdk开发小型应用程序. sdk中有什么方法可以实现我可以实现的功能,以允许用户使用SDK中提供的任何API上传图片.

I am working on small application using the lync 2013 sdk. Is there any way provided in sdk where I can implement a functionality to allow user to upload his picture using any API provided in the SDK.

如果可以的话,如果在活动目录中配置了用户,那么最佳的存储方式和位置是什么?

If it is possible then what and where is the best way to store it, if the users are configured in the active directory?

等待您的积极回应.

致谢

授予

推荐答案

2013年12月11日更新

最新的Lync更新( Lync Client CU3(11月更新))可以选择将照片添加回GUI.

Update as of 12/11/2013

The latest Lync update (Lync Client CU3 (November Update)) has the option to set a photo added back to the GUI.

  • Link to the KB Article
  • Link to the Download

可在此处找到带有说明和屏幕截图的文章:

Article with explanations and screenshots can be found here: Lync Client CU3 (November Update) – Show a picture from a website!.

尽管这是一个不同的问题,但我对此问题的回答(为应用程序端点显示照片)在此处有效好:

Though this is a different problem, my answer to this question (Displaying a photo for an Application endpoint) is valid here as well:

基本上,可以使用一个选项将用户的照片设置为URL,但不再显示在Lync 2013客户端界面中(在Lync 2010客户端中已显示).如果您可以获取将图像发布到网络可访问位置的代码,则可以发布URL并以这种方式更改用户图片.

Basicly, there is an option to set a user's photo to an URL, but it is no longer displayed in the Lync 2013 client interface (it was there in the Lync 2010 client). If you can get your code to publish the image to a web-accessible location, you could publish the URL to it and change your user picture that way.

作为参考,另一个问题的答案:

For reference, the answer to the other question:

LocalEndpoint.LocalOwnerPresence上完成发布状态信息(包括照片设置). UserEndpointApplicationEndpoint都是从LocalEndpoint派生的,因此这应该确实可行.

Publishing presence information (which includes photo settings) is done on the LocalEndpoint.LocalOwnerPresence. Both UserEndpoint and ApplicationEndpoint derive from LocalEndpoint, so this should be doable really.

实际发布会变得有些复杂,因为要发布的级别"有很多不同的组合:

The actual publishing gets slightly complex because there are a lot of different combinations of 'levels' to publish on:

首先,您需要了解很多InstanceID值,请在此处进行阅读:

First, there are a bunch of InstanceID values that you need to know about, read up on them here: Presence data source and category instance ID

第二,存在此存在对象的值,请参见Microsoft.Rtc.Collaboration.Presence.PresenceRelationshipLevel.不要在Unknown上发布,您会遇到异常.

Second, there is a value for who this presence applies to, see Microsoft.Rtc.Collaboration.Presence.PresenceRelationshipLevel. Don't publish on Unknown, you'll get an exception.

public enum PresenceRelationshipLevel  
{  
    Unknown = -1,  
    Everyone = 0,  
    External = 100,  
    Colleagues = 200,  
    Workgroup = 300,  
    Personal = 400,  
    Blocked = 32000,  
}

您需要发布用户照片属性的PresenceCategoryWithMetaData,它是容器0x5状态信息"的一部分.

You need to publish a PresenceCategoryWithMetaData for the user photo properties, which is part of container 0x5, "Presentity information".

var photoPresence = new PresenceCategoryWithMetaData(
    0x5, // The container id
    (int)PresenceRelationshipLevel.Everyone,
    new ContactCard(0x5) // Same container ID again
    {
        IsAllowedToShowPhoto = true,
        PhotoUri = "<uri to your photo here"
    });

您也可以在该对象上设置一个ExpiryPolicy,确实应该是自解释的.然后将此状态对象发布到您的端点上:

You can set an ExpiryPolicy on this object too, should be self explainatory really. Then publish this presence object on your endpoint:

Endpoint.LocalOwnerPresence.BeginPublishPresence(new[] { photoPresence  }, cb => { 
    Endpoint.LocalOwnerPresence.EndPublishPresence(cb);
}, null);

这确实应该做到.我最终明确地发布了所有关系级别的内容,因为它没有按照逻辑上的预期层叠数据.

And that should do it, really. I ended up explicitly publishing to all relationship levels because it didn't cascade the data as logically expected.

这篇关于在Lync 2013中显示用户图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆